M.Tech 1st year, II SEM EMBEDDED NETWORKS UNIT

M.Tech 1st year, II SEM EMBEDDED NETWORKS UNIT

M.Tech 1st year, II SEM EMBEDDED NETWORKS UNIT - III Ethernet Basics EMBEDDED NETWORKS; UNIT III: Ethernet Basics 1 CONTENTS 1) 2) 3) 4) 5) 6)

Elements of a Network Inside Ethernet Building a Network: Hardware options Cables, connections and network speeds Interfacing to ethernet controllers The application: Providing and using network data 7) IP: Internet addressing and routing EMBEDDED NETWORKS; UNIT III: Ethernet Basics 2 CONTENTS contd 8) 9) 10) 11) 12) 13)

14) The ethernet driver and controller: The Hardware interface Connecting interfaces Design choices Rabbit Semiconductor RCM3200 Dallas Semiconductor DSTINIM400 (TINI): Microchip Technology picdem.net demonstration board Inside the Internet Protocol EMBEDDED NETWORKS; UNIT III: Ethernet Basics 3 IMPORTANT POINTS The computers exchange information between each other using a specific local interface known as USB or RS 232. The computer can transfer the information beyond its local

interfaces to send and receive information of any kind. This is possible with a network connection. Network protocols are those which support communication between the computers of any type. By using these network protocols, each system can share the data between other where in the systems are connected in a network of embedded systems. A popularly networking standard known as Ethernet will lead the other local networks. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 4 The products will be designed in such a way that they are designed for use in networks which have support for Ethernet built in. A router or gateway enables an Ethernet network to communicate with computers in other networks, including computers on the internet.

Two or more computers that share a network connection form a local area network, or LAN. The largest network is considered to be the internet by which the computers in a local network can access resources on the Internet and make local resources available to any computer on the Internet. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 5 ELEMENTS OF A NETWORK Exchange of data can occur by using the physical components that enable the computers in a network. And in every network, the computers must agree about how to share the data path that connects the computers, to help ensure that transmitted data gets to its destination. Components:

The communication between the two or more computers will be done in which one of the computers is an embedded systems which is used to perform a specific task or a series of related tasks. A defined physical interface, to ensure that the output of a transmitting computer is compatible with the inputs of the receiving computers. For Ethernet networks, the Ethernet standard specifies this interface. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 6 Cables or wireless transceivers to connect the computers. Ethernet networks have several options for cables. An Ethernet interface may also connect to a device called a wireless access point, which enables the embedded system to access a wireless network. Modular Design: To make designing and maintaining a network as easy as

possible, most networked computers use modules, or components, that work together to handle the job of network communications. Each module is responsible for a single task or a small set of related tasks. Each module knows how to exchange information with one or more of the other modules, but the modules dont need to know details about how the other modules accomplish their tasks. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 7 The modular approach has a couple of benefits. If each module is as independent as possible, its easier to make changes when needed, possibly even swapping in a different module entirely, without requiring changes in the other modules. And isolating problems is easier when a single module contains all of the code to perform a function. A module may consist of hardware, software, or a

combination. A software module may be as small as a procedure or subroutine within a larger application or unit of code. Or a module may be a library of routines or a class or package of classes in a separate file. In an embedded system, the program code may be referred to as firmware, which typically means that the code is stored in Flash memory or another nonvolatile memory chip, rather than on a disk drive. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 8 Users may have the ability to load new firmware into a device, but the new firmware is typically an update or upgrade to existing code, rather than an entirely different type of application. The network protocol stack: A computers network protocol stack consists of the modules involved with networking as shown in the figure below.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 9 At the bottom of the stack is the hardware interface to the network cable. At the top of the stack is a module or modules that provide data to send on the network and use the data received from the network. In the middle there may be one or more modules involved with addressing, error-checking, and providing and using status and control information. In transmitting, a message travels down the stack from the application layer that initiates the message to the network interface that place the message on the network. In receiving, the message travels up the stack from the network interface to the application layer that uses the data in the received message. The number of layers a message passes through can vary. For some messages that travel only within a local network, the application layer can communicate directly with the Ethernet driver. Messages that travel on the Internet must use the Internet Protocol. Messages that use

the Internet Protocol can also use the User Datagram Protocol or the Transmission Control Protocol to add error checking or flow-control capabilities. 10 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The Application: Providing and Using Network Data The application provides data to send on the network and uses data received from the network. An application often has a user interface that enables users to request data from a computer on the network or provide data to send on the network. In an embedded system, the user interface may just enable basic configuring and monitoring functions, while the system performs its network communications without user intervention. The data that the application sends and receives may be anything: a single byte; a line of text; a request for a Web page; the contents of a Web page; a file containing text, an image, binary data, or program code; or anything that a

computer wants to send to another computer in the network. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 11 The data sent by an application follows a protocol, or set of rules, that enables the application at the receiving computer to understand what to do with the received data. An application may use a standard protocol such as the hypertext transfer protocol (HTTP) for requesting and sending Web pages, the file transfer protocol (FTP) for transferring files, or the simple mail transfer protocol (SMTP) or Post Office Protocol (POP3) for e-mail messages. Applications may also send and receive data using application-specific protocols. In an embedded system, the application might be a module that periodically reads and stores sensor readings or the states of other external signals, or an application might use received data to control motors, relays, or other circuits. An embedded system can function as a Web server that receives and responds to requests for

Web pages, which may enable users to provide input or view realtime data. Embedded systems can send and receive information 12 EMBEDDED NETWORKS; UNIT III: Ethernet Basics via e-mail and in files via FTP. TCP and UDP: Error Checking, Flow Control, and Ports A network communication often includes additional information to help data get to its destination efficiently and without errors. A module that supports the Transmission Control Protocol (TCP) can add information for use in error checking, flow control, and identifying an application-level process at the source and destination computers. Error-checking values help the receiver detect when received data doesnt match what was sent. Flow-control information helps the sender determine when the receiver is ready for more data. And a value that identifies an application-level port, or process, can help in routing received data to the correct process in the application layer. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

13 TCP performs all of these functions. Many Internet and localnetwork communications such as requests for Web pages and sending and receiving e-mail use TCP. Windows and other operating systems have support for TCP built in. Development kits for network-capable embedded systems often include libraries or packages with TCP support. In sending data using TCP, the application layer passes the data to send and values that identify the datas source and destination to a TCP layer. The TCP layer creates a TCP segment that consists of a header followed by the application data. The header is a defined structure with fields containing information used in error checking, flow control, and routing the message to the correct port at the destination. The TCP layer doesnt change the message to be sent. It just places the message in the data portion of the TCP segment. The TCP segment encapsulates, or provides a container for, the data received from the application layer. The TCP layer then passes the segment to the IP layer for transmitting on the network.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 14 In the other direction, the TCP layer receives a segment from the IP layer, strips the TCP header, and passes the segment to the port specified in the TCP header. A simpler alternative to TCP is the User Datagram Protocol (UDP). Like a TCP segment, a UDP datagram has a header, followed by a data portion that contains the application data. UDP includes fields for specifying ports and optional errorchecking, but no support for flow control. IP: Internet Addressing and Routing The Internet Protocol (IP) layer can help data get to its destination even if the source and destination computers are on different local networks. As the name suggests, the Internet Protocol enables computers on the Internet to communicate with each other. Because IP is closely tied to TCP and UDP, local networks that use TCP and UDP also use 15

EMBEDDED NETWORKS; UNIT III: Ethernet Basics IP. The term TCP/IP refers to communications that use TCP and IP. The term can also refer more broadly to the suite of protocols that includes TCP, IP, and related protocols such as UDP. The interface on the Ethernet network can identify the unique hardware address. IP addresses are more flexible because they are not more specific to a network type. A message that uses IP can travel through different types of networks, including Ethernet, token-ring, and wireless networks, as long as all of the networks support IP. While sending a message the TCP layer passes the TCP segment and the source and destination address to the IP layer. The IP layer encapsulates (to express the essential features) the TCP segment in an IP datagram, which consists of a header followed by a data portion that may contain a UDP datagram or a TCP 16 EMBEDDED NETWORKS; UNIT III: Ethernet Basics

segment. The header has fields for the source and destination IP addresses, error checking of the header, routing, and a value that identifies the protocol, such as TCP or UDP, used by the data portion. Similarly, a UDP may pass a UDP datagram to the IP layer. In receiving a message, the IP layer receives an IP datagram from a lower level in the network stack. The IP layer performs error-checking and uses the protocol value to determine where to pass the contents of the data portion. In the IP header, the source and destination IP addresses identify the sending and receiving computers. The IP addresses that are being used by the computer must have an unique address within the network or the networks that the sending computer can communicate with. The addresses are reserved in three blocks for local networks and these addresses can be used by the local UNIT

networks. 17 EMBEDDED NETWORKS; III: Ethernet Basics The Internet Corporation for Assigned Names and Numbers (ICANN) assigns blocks of addresses to Internet Service Providers and others who may in turn assign portions of their addresses to other users. Three protocols are often used along with IP for assigning and learning IP addresses. They are dynamic host configuration protocol (DHCP), domain name system protocol (DNS), address resolution protocol (ARP). A computer functioning as a DHCP server can assign addresses to the computers in a local network. For assignment of the addresses the DHCP server uses DHCP protocol. A computer which functions as a DNS server can send the information by accepting the request from the DNS protocol

which allows the computer to learn the IP address of the domain like lvr.com. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 18 ARP request can be broadcasted by a computer that wants to learn the Ethernet hardware address corresponding to a IP address in a network. A communication in a local network that doesnt use TCP or UDP may not require IP. Instead, the application layer may communicate directly with a lower layer such as the Ethernet driver. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 19 The Ethernet Driver and Controller: The Hardware Interface

In an Ethernet network, the interface to the network is an Ethernet controller chip and its driver. The Ethernet driver contains program code that manages communications between the controller chip and a higher level in the network protocol stack. To send an IP datagram over an Ethernet network, the IP layer passes the datagram to the Ethernet controllers driver. The driver instructs the Ethernet controller to transmit an Ethernet frame containing the datagram, preceded by a header that contains addressing and error-checking information. In receiving an IP datagram from the network, the Ethernet controller checks to see if the destination address matches the interfaces hardware address or a multicast or broadcast address 20 EMBEDDED NETWORKS; III: is Ethernet Basics the

that the controller is configured to accept. If UNIT there a match, controller checks for errors Ethernet Controller EMBEDDED NETWORKS; UNIT III: Ethernet Basics 21 INSIDE ETHERNET A little knowledge about Ethernet can help in selecting network components, writing the software that exchanges data over the network, and troubleshooting any problems that come up. NOTE: For advantages and limitations refer to text book page no

15-19. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 22 BUILDING A NETWORK:HARDWARE OPTIONS If one want to build an Ethernet network then it require making choices about network speed, cable type, and methods of connecting the network to the computer. A networked embedded system can be developed by connecting it to a PC at some point. A popular configuration for networked embedded system follows the specification for the 10BASE-T media system in the Ethernet standard. Twisted pair cables will be used in 10BASE-T network which supports a speed of 10Mbps. Many Ethernet-capable modules have built-in support for 10BASE-T networking, and any recent-vintage standard PC with Ethernet support will support

23 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 10BASE-T as well. The following components are required for connecting a PC to an embedded system in a 10BASE-T network. A PC with Ethernet support and a 10BASE-T interface: The network supported by a PC can be found out by looking into Windows Device Manager under network adapters. This is shown in the figure below. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 24 To view the Device Manager in Windows XP, click in order Start, Settings, Control Panel, System, Hardware, and Device Manager. Or in any recent Windows edition, from the Windows desktop, press F1 and search for Device Manager.

The adapters name usually includes the supported speed or speeds. An Advanced tab may also offer choices under Media Type. For example, you may be able to configure a multi-speed, auto switching card to use one speed only. (This option can be useful if your PC connects to a multi-speed repeater hub and you want to view network traffic at another speed in a protocol analyzer). For some PCs that dont have 10BASE-T interface, a network interface card can be used that plugs into the computers internal PCI bus. Also a USB adapter can be used that attaches to a USB port or an Ethernet/PC Card adapter can be used that plugs into a PC card slot. 25 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Most 10 BASE-T interfaces, like other twisted-pair Ethernet interfaces, use RJ-45 connectors. These are similar in design to modular telephone connectors, but with eight contacts instead of four.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 26 An embedded system with a 10 BASE-T Ehternet interface: The embedded system must have an Ethernet controller, which may be a discrete chip or a portion of a chip that performs other functions. The Realtek RTL8019AS is an example of a popular controller chip for 10BASE-T systems. A cable to connect the PC and embedded system or a repeater hub or Ethernet switch and cables to connect to it: The number and type of cables depend on the connections between PC and embedded system to each other directly or connections are being made through a repeater hub or switch. The figure below shows the both types of connections. Twisted pair Ethernet cable is available in two wiring configurations: straight through (1-to-1) and crossover. In a straight through cable, the connections on both connectors are

the same. For example, on both connectors, pin 6 connects to the green wire, and pin 2 connects to the orange wire. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 27 An embedded system with a 10BASE-T Ethernet interface EMBEDDED NETWORKS; UNIT III: Ethernet Basics 28 In a crossover cable, the pin connections for some of the wires are swapped from one of the cable to the other. For example, on one connector, pin 2 connects to the orange wire and pin 6 connects to the green wire, while at the other end of the cable, pin 2 connects to the green wire and pin 6 connects to the orange wire. To connect an Embedded System directly to a PC, a crossover

cable rated as Category-3 or higher is required. The standard can be used at higher speeds by using Category-5e cable which is recommended by the IEEE 802.3 standard. If suppose the user can invest more then Category-6 cable can also be a good investment. Also Category-5 cable can be used which may be preferred in some electrically noisy environments. Crossover cables are widely available which have an RJ-45 plug at each end and can be up to 100 meters 29 EMBEDDED NETWORKS; UNIT III: Ethernet Basics long. If a PC is already in a network or if the user wants to connect more than one embedded system to a PC, a repeater hub or Ethernet switch can be used. These are the devices for connections with multiple cables. To connect an embedded system to a PC, this can be done through a repeater hub or Ethernet switch. For connection straight through cables which are rated as Category 3 or

higher can be used. Also Category 5, Category 5e, or Category 6 cables are also accepted. Additional PCs or embedded systems can be made to attach to the remaining ports of repeater hub or Ethernet switch. The figure shown below is a hub which has multiple ports for connecting interfaces to a network. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 30 A hub has multiple ports for connecting interfaces to a network Generally, to use a repeater hub or switch, just attach the cables, apply power, and the device is ready for use. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 31

CABLES, CONNECTIONS AND NETWORK SPEEDS For a network interface to work exactly, a connection to the other computers in the network is necessary. Cable Types for Different Uses: Twisted pair, Fiber optic, and coaxial cable are the three cable types that Ethernet standard allows. The table shown below summarizes the features of each cable type. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 32 Twisted pair cable is widely used because it is inexpensive and also performance is good. Fiber-optic cable is immune to electromagnetic interference and can carry signals much longer distances, but at higher cost. Coaxial cable was the original cable type for Ethernet and isnt recommended for new networks. The IEEE 802.3 standard defines a variety of media systems

that each use a particular cable type at a specific bit rate. For example, the 10BASE-T media system uses unshielded twisted pair cable at 10 Mb/s. If a user is connecting an embedded system to an existing network but uses a different media system other than network, cable converters and multi-speed repeater hubs and switches are available. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 33 Cable Categories: The task of selecting a cable type can be made simple through various documents which define cable categories according to performance, interconnection method, and other characteristics. Many cable manufacturers specify when a product is suitable for a specific media system, such as fiber-optic cable that meets the requirements for a 10BASE-FL media system. An important document for specifying networking cable is TIA/EIA

568: Commercial Building Telecommunications Cabling Standards. The documents sponsors are two trade groups: the Telecommunications Industry Association (TIA) and the Electronic Industries Association (EIA). The TIA/EIA-568-B edition of the standard, released in 2001, covers fiber-optic and twisted-pair cable. The earlier (-A) edition also covered coaxial cable, but the new edition doesnt recommend coaxial cable for new installations. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 34 NOTE: The IEEE 802.3 standard also references ISO-IEC 11801: Information Technology - Generic Cabling For Customer Premises. This standard is a product of the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC). The standard duplicates much of the contents of TIA/EIA 568, with minor differences and the addition of information relating to

components used primarily in Europe. For fiber-optic cable, the IEEE 802.3 standard references documents from the IEC and the American National Standards Institute (ANSI). The U.S National Electric Code (NEC) rate cables according to flammability, heat resistance, and visible smoke on exposure to flame. These cables are categorized into three types depending on the usage. General purpose cable, Plenum cable, and nonplenum cable. Their description is given as below. 35 EMBEDDED NETWORKS; UNIT III: Ethernet Basics General-purpose cable is for use on a single floor, but not for routing through floors or ceilings. Plenum cable is suitable for all locations, including routing through plenums. Non-plenum cable may be allowed in plenum spaces if enclosed in metal conduit (a channel for conveying water or other fluids). Plenum is an area that functions as a part of the heating, ventilation, and air conditioning (HVAC) system. Attaching connectors:

Connectors can be bought for all cable types so that they can be attached to the connectors. Connectors can be attached to the twisted pair cables in a straight forward manner but require few tools. Attaching connectors to fiber-optic cable is more complicated and requires a greater investment in materials and equipment. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 36 Twisted Pair Cable: Twisted pair cable is widely used because it is inexpensive and also can carry signals over long distances. Noise in the cable can be reduced by the number of twists in two ways : by reducing the size of the magnetic field (magnetic field intensity has the tendency to produce noise) that emanates (spreadout) from the wires and by canceling any noise the wires pick up via magnetic coupling. Cable Categories: Networks of all three speeds can use cable that meets the Category

5e specification defined in EIA/TIA-568-B. A Category 5e cable contains four unshielded twisted pairs (UTPs) of wires. Each pair consists of two insulated conductors that spiral, or twist, around each other, with about one to three twists per inch. This is shown in the figure below. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 37 Twisted-pair cable for Ethernet The conductors may be solid or stranded. A stranded conductor, which consists of many small-diameter wires, can withstand repeated flexing and is a good choice for patch cords and other uses where the users are likely to move or reroute the cable frequently. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 38

A solid conductor, which is a single, larger-diameter wire, has better electrical performance but may break after repeated flexing. Solid conductors are a good choice inside walls and in other locations where the wiring doesnt move once installed. In the EIA/TIA-568-B standard, Category 5e cable replaces the Category 5 cable recommended in earlier editions of the standard. Although Category 5 cable is acceptable for all three Ethernet speeds. Category 6 cable is suitable for all twisted-pair Ethernet networks with the exception of some networks in industrial environments. For 10Mb/s, Ethernet, lower quality category 3 cable can be used. If upgraded to faster speed, then Category 5 or greater can be used. A 10-Mb/s or Fast Ethernet cable segment uses two of the four pairs in a cable. One pair carries data in each direction. In a 10-Mb/ s segment, phone wiring can use the other two pairs, though there is 39 some risk of interference. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

Gigabit Ethernet uses all four wire pairs in a complex signaling protocol that enables all eight wires to transmit and receive at the same time. The usual connectors for twistedpair Ethernet are RJ-45 plugs and jacks. A cable segments performance is no greater than the lowest rating of the cable, its connectors, and the jacks the connectors plug into. To gain the benefit of a cables rated performance, the cable should use connectors with the same or better rating, and the connectors should plug into jacks with the same or better rating. For example, Category 5e cable should use connectors and jacks rated as Category 5e or Category 6. Ethernet transceivers are designed to work with cables that have a characteristic impedance of 100 ohms. A cables characteristic impedance is the input impedance of an infinite, open line. 40 EMBEDDED NETWORKS; UNIT III: Ethernet Basics A lines physical length has no effect on its characteristic

impedance. There are techniques for calculating or measuring characteristic impedance. Cable manufacturers specify the characteristic impedance of cables suitable for networking. Category 3 through Category 6 cable all have 100-ohm characteristic impedance. Using cable with a different characteristic impedance can degrade signal quality and result in data errors. The wires in the twisted-pair cables are color-coded (as shown in the table below), with a color (blue, orange, green, or brown) assigned to each twisted pair. One wire in the pair is predominantly white with colored stripes or splashes and the other wire in the pair is predominantly colored, with optional white stripes or splashes. For example, if one wire in a pair is blue, the other wire in the pair is predominantly white with blue stripes. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 41 : Category 5 cable Pair Number

1 2 3 4 Predominant Color Stripe or Splash Color White Blue Blue White or none

White Orange Orange White or none White Green Green White or none White

Brown Brown White or none EMBEDDED NETWORKS; UNIT III: Ethernet Basics 42 The electrical interface for twisted-pair cable uses differential signaling, which requires two wires to carry a signal. The voltage on one wire is the negative, or complement, of the voltage on the other wire. The receiver detects the difference between the voltages, and any noise that is common to both wires cancels out. A line that uses differential signaling is called a balanced line. Shielded Twisted Pair Cable: Twisted pair cables are of two types i.e. Shielded and Unshielded. Unshielded twisted pair cables may not be used all the times. Ethernet networks can also use shielded twisted pair cables. A

shield can reduce noise due to capacitive, electromagnetic, and high-frequency magnetic coupling. The TIA-EIA-568 standard specifies requirements for two shieldedcable types suitable for Ethernet networks: 100-ohm screened twisted-pair (ScTP) cable and 150-ohm shielded twisted-pair (STP) 43 cable. EMBEDDED NETWORKS; UNIT III: Ethernet Basics In ScTP cable, the shielding consists of a layer of plastic and metal tape surrounding the pairs and a conductive drain wire or braid contacting the metal side of the tape. In STP cable, each pair has its own shield as well. STP cable requires 100:150 transformers for impedance matching between the 150-ohm cable and the 100-ohm network interface. Connectors for shielded cable must also be shielded, with a continuous shield from the cable to the connector. The shield should be grounded at one end only. Shielded cable is more expensive and many networks dont need it. For 10-Mb/s networks, the IEEE 802.3 standard does

not allow shielded cable but prefers unshielded twisted pairs which meet most networks requirements. A Fast Ethernet cable segment may use unshielded or shielded twisted-pair cable. For Gigabit Ethernet, the standard just says that the use 44 EMBEDDED NETWORKS; UNIT III: Ethernet Basics of shielded cable is not preferred. Connector Wiring: There are two common pin outs for the RJ-45 connectors used with twisted-pair cable: T568A and T568B. The TIA/EIA-568-B standard allows either, but recommends T568A. Wire Color Pin No T568A

T568B 1 2 3 4 5 6 7 8 white with green stripe/splash green white with orange stripe/splash blue white with blue stripe/splash orange white with brown stripe/splash brown

white with orange stripe/splash orange white with green stripe/splash blue white with blue stripe/splash green white with brown stripe/splash brown EMBEDDED NETWORKS; UNIT III: Ethernet Basics 45 In the table it can be seen that the only difference between two pin outs is the swapping of wires in pairs 2 and 3. Within a cable (except for crossover cables), both ends must use the same pin out. The only difference between the two pin outs is the color of the wires at the pins.

With T568A, pins 1 and 2 are the green pair and pins 3 and 6 are the orange pair, while with T568B, pins 1 and 2 are the orange pair and pins 3 and 6 are the green pair. At 10 and 100 Mb/sec., pins 1 and 2 always carry traffic from an interface, and pins 3 and 6 always carry traffic to an interface. Instead of using different pin outs in a network, the best way is to standardize on a single pin out and use it throughout if possible. Most RJ-45 connectors are designed for use with either solid or stranded conductors, but not both. If suppose the cables are being made on own then the user has to be sure that connectors match the 46 EMBEDDED NETWORKS; UNIT III: Ethernet Basics conductor type. Crossover Cables: A crossover cable enables connecting two twisted-pair 10Mb/s or Fast Ethernet interfaces directly, without going through a repeater hub or switch. Another use for crossover cables is to connect two repeater hubs or switches when neither has an available uplink port.

The cable swaps the green and orange pairs. In other words, at one end of the cable, pins 1 and 2 are the green pair and pins 3 and 6 are the orange pair, and at the other end, pins 1 and 2 are the orange pair and pins 3 and 6 are the green pair. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 47 Adding Connectors to Twisted-pair Cables: Category 5 and higher cables with connectors attached are readily available in a variety of lengths. Some vendors will make cables of custom lengths. For making the cables we need the following: Cable of the desired type and fire rating, such as Category 5e, solid conductor, general-purpose. Connectors with the same or better rating as the cable, and suited for solid or stranded cable as needed. A cable crimper for attaching the connectors.

A cable stripper for removing the outer cable jacket. Also a utility knife will do. A cable cutter to cut the cable and trim the conductors in the cable. A cable tester to verify the connections. NOTE: For the steps in attaching connectors to a cable refer the text book page nos (50-53). EMBEDDED NETWORKS; UNIT III: Ethernet Basics 48 Fiber Optic Cable: In the copper wires of twisted-pair cable, the data signals are electrical voltages. In fiber-optic cable, signals transmit as pulses of light. Here, the term light refers to electromagnetic radiation of visible wavelengths as well as the slightly longer, invisible wavelengths of infrared energy. Fiber-optic communications may use visible or infrared light. As with twisted-pair networks, fiber-optic networks use repeater hubs and switches to connect interfaces to the

network. NOTE: For advantages and limitations refer page nos 54-57. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 49 Construction: A typical fiber-optic cable with one fiber strand contains a flexible glass or plastic core surrounded by a reflective cladding and a protective coating. The protective coating contains a buffer to protect the core and its cladding, a strength material to enable pulling cable during installation without stretching the fiber, and an outer jacket to protect the entire assembly. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 50

A single cable may contain multiple strands of fiber in a single jacket. Duplex cable has two strands and is useful for Ethernet segments, which require a strand for each direction. At each end of an Ethernet fiber-optic cable segment are a transmitter and receiver. A transceiver module contains a transmitter and a receiver in a single unit. The transmitter converts electrical signals to optical signals to be carried by a strand of fiber. The module contains a light source, an electrical interface, and either a connector or a fiber pigtail (a short length of fiber) for splicing to a strand of fiber. The light source may be a light-emitting diode (LED) or a semiconductor laser. Lasers generally have faster switching times, while LEDs are cheaper. The transmitter may generate pulses of light in either of two ways. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 51

The transmitter may switch the light source on and off by switching the input current to the light source. Or the light source may be on all of the time, with circuits that modulate, or control, the transmitters output by alternately blocking the light and letting it pass. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 52 The photo detector is a photodiode or phototransistor that converts received optical signals to electric current. Additional circuits in the module convert the current to voltages. Length limits for fiber-optic cable are due to attenuation and dispersion of the signals in the cable. Causes of attenuation are absorption, scattering, and leakage of the light as it travels in the fiber. Dispersion is the gradual widening of pulses as they travel

along a fiber, eventually making it hard to distinguish the transitions between pulses. In half-duplex segments, the need to detect collisions limits the round-trip travel time of data and further limits the maximum segment length. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 53 Specifications for fiber optic cable: Specifications for fiber-optic cable include whether the cable is single mode or multimode and the diameters of the core and cladding. A mode is a stable pattern, or path, that light may take as it propagates through a fiber. The diameter of a fiber strand and the composition of the fibers core and cladding limit the number of paths. Single-mode fiber has just one path and can carry signals at high bit rates and over long distances. In multimode fiber, a signal may use any of multiple modes to travel in the fiber.

Multimode fiber is less expensive and is adequate for most Ethernet networks. The IEEE 802.3 standard requires multimode fiber for 10-Mb/s and Fast Ethernet. Gigabit Ethernet may use multimode or single-mode fiber. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 54 The diameters recommended by the IEEE 802.3 standard for multimode fiber are 62.5 m for the core and 125 m for the m for the core and 125 m for the core and 125 m for the m for the cladding. This type of cable is referred to as 62.5/125 cable. The standard also provides guidelines for systems that use 50/125 cable, which can have better performance at a similar price. The single-mode fiber available as an option for Gigabit Ethernet is 10/125 cable. Connectors: The IEEE 802.3 standard recommends specific connector types for use in segments of different speeds. For 10-Mb/s segments, the standard requires the BFOC/2.5 connectors

commonly known by the trademarked name ST connector (shown in the figure below) .For Fast Ethernet, the standard recommends using Low Cost Fiber Optical Interface Connectors, known by the trademarked name of duplex SC 55 EMBEDDED NETWORKS; UNIT III: Ethernet Basics connector. Two popular connectors for fiber-optic cables EMBEDDED NETWORKS; UNIT III: Ethernet Basics 56 Where saving space is important, small-form-factor (SFF) connectors are available. The SFF LC (Lucent Connector) connectors introduced by Lucent Technologies are available from a variety of sources. In a duplex connection, LC connectors are half the size of SC connectors. The connectors

use the same latching mechanism as RJ-45 connectors. Coaxial Cable: The third option for Ethernet cabling is coaxial cable (shown in the figure below). A coaxial cable, or coax for short, consists of a copper core surrounded by an insulating sleeve, a solid or braided metal shield, and a protective jacket. The copper core is the conductor, and the shield serves as a ground. The term coaxial refers to the way that the core and the shield that surrounds it are symmetrical around a line, or axis. 57 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Coaxial cable EMBEDDED NETWORKS; UNIT III: Ethernet Basics 58

Coaxial cable was the only cable type specified in Ethernet networks but coax is not a common term in new networks for several reasons. The coaxial cable can be used only in 10Mb/s networks. If suppose a cable is used and later want to upgrade speed then new cables are required. With twisted-pair or fiberoptic cable, the same cables can be used if speeds are modified. Also, compared to coaxial cable, twisted-pair cabling is cheaper and easier to connect, and fiber-optic cable allows longer cable segments and has other benefits. So about the only reason for using coaxial cable is for compatibility with an existing system. The IEEE 802.3 standard allows the use of two types of coaxial cable, commonly known as thick coax, at about 10mm in diameter and thin coax, at about 5mm in diameter. For each, the standard specifies maximum segment length, methods of attaching interfaces, and other requirements EMBEDDED NETWORKS; UNIT III: Ethernet Basics 59 Of the two, thin coax was more popular. A segment of thin

coax can be between 0.5 and 185 meters long. The cables use BNC (Bayonet Neill Concelman , used for radio frequency) connectors. To attach interfaces to thin coax, a network may use a single cable segment with T connectors, multiple segments that connect to repeaters, or a combination. A segment of thin coax may consist of multiple lengths of cable connected in series via T connectors, with the third leg of each T connector attached to an interface. A segment may have up to 30 interfaces connected in this way. The stub from a T connector to an interface must be no more than 4 cm. A network can also use a repeater with attachment points for multiple cables. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 60 Thick coax is much less convenient to set up. Each interface must have a transceiver that attaches directly to the cable,

typically via a vampire tap that clamps onto the cable. A stub of up to 50 meters connects the transceiver to the interface. To reduce reflected voltages, the taps must be attached at multiples of 2.5 meters along the cable. The cable is bulky compared to thin coax. A segment of thick coax can be up to 500 meters, however, with up to 100 interfaces attached to it. Both types of coaxial cable have a characteristic impedance of 50 ohms and require a 50-ohm termination at each end of a cable segment. For both, the shield is grounded at one end only. The IEEE 802.3 standard has additional specifications for coaxial cable. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 61 Connections for Harsh Environments The recommendations so far have all assumed that the cabling and other equipment will be in an office or equivalent setting

where the environment does not present any special challenges to the cables, connections, and data being transmitted. But some embedded systems must function where the components are subjected to one or more of the following: Electromagnetic interference (EMI) from motors and other industrial equipment. Extreme temperatures (hot or cold). Vibration. Liquids, including water, oil, and corrosive substances. Dust or dirt. 62 EMBEDDED NETWORKS; UNIT III: Ethernet Basics For these environments, industrial-grade cables and Cables: To reduce problems caused by electromagnetic interference,

use fiber-optic cable or shielded twisted-pair cable. In environments where there is high-frequency electrical noise, Category 5 cable may be a better choice than Category 5e or Category 6 cable, which are more sensitive to high-frequency noise. The TIA is developing a standard for industrial-grade twistedpair cable, tentatively called Category 5i cable. Connectors: Harsh environments may also require ruggedized connectors to replace the usual office-grade RJ-45 connectors. One option is the M12 connector available from Lumberg Inc. and others. This is shown in the figure below. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 63 The M12 connector The connector is about 12mm in diameter and has four or eight contacts, with one contact in the center and the rest

arranged in a circle around the center. A threaded housing secures the connector on the enclosure and protects the contacts from environmental hazards. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 64 For use with systems that use RJ-45 connectors, there are adapters that connect an RJ-45 jack to an M12 connector and cables that have an RJ-45 plug on one end and an M12 connector on the other. Enclosures A system that operates in a harsh environment will also need an enclosure that shields the circuits from electrical noise and environmental hazards. Circuits in dusty environments often cant use fans for cooling, but low-power components and circuits can eliminate the need for a fan. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

65 Supplying Power: Many embedded systems are located near reliable power sources. At most, a system near a power source needs a rectifier to convert alternating current (AC) to direct current (DC) and one or more voltage regulators to provide the DC voltages required by CPU and other components. For systems that arent located near a power source, one option is to use battery power and either replace the batteries as needed or recharge the batteries via solar cells or another energy source. Another option is to provide power over the same cabling that connects the system to the network. The Power Sourcing Equipment (PSE) that provides power can be in either of two locations. An Endpoint PSE is inside the repeater hub or switch that connects to the powered device (PD). A Midspan PSE is a separate device that connects between a repeater or switch and the powered device. Segments at 1000 Mb/s can use Endpoint

PSEs only. 66 EMBEDDED NETWORKS; UNIT III: Ethernet Basics SUPPLYING POWER EMBEDDED NETWORKS; UNIT III: Ethernet Basics 67 Going Wireless: The term wireless Ethernet usually refers to a network that follows one of the IEEE 802.11 standards. The main 802.11 standard, like Ethernets 802.3 standard, specifies a physical layer and a method of media-access control for networking. The physical layer may use radio-frequency (RF) transmissions in the 2.4 Gigahertz frequency band or infrared transmissions. Both allow transmitting data at 1 or 2 Mb/s.

A popular standard for wireless networks has been the 802-11b supplement, which describes the interface known as Wi-Fi, for wireless fidelity. An 802-11b interface transmits at up to 11 Mb/s in the 2.4 Gigahertz band. The 802-11g supplement approved in 2003 enables transmitting at 54 Mb/s in the same band and can fall back to the 802-11b rate when needed. Networks that use the physical layer described in the 802-11a supplement transmit at up to 54 Mb/s in the 5 GigahertzEMBEDDED band. NETWORKS; UNIT III: Ethernet Basics 68 The easiest way to connect a device with an Ethernet interface to a wireless network is to use a wireless access point. The access point has an 802-11b or other wireless interface and connects via a cable to an interface that wants to communicate over the wireless network. Initial configuration of the access point typically requires a PC, but once the access point is configured, the network administrator can usually change the configuration via a Web page hosted by the access point. Media Systems:

The media systems defined in the IEEE 802.3 standard each use a particular cable type at a specific network speed. So for example, a 10-Mb/s twisted-pair network uses a different media system than a Fast Ethernet twisted-pair network or a 10-Mb/s fiber-optic network. For each media system, the standard specifies the electrical characteristics, signaling 69 EMBEDDED NETWORKS; UNIT III: Ethernet Basics protocol, and methods of connecting to an interface. The standard uses a system of identifiers to distinguish the media systems. Each identifier has three elements. The first number is the network speed in Megabits per second (10, 100, 1000) or bits per second (10G). Then the word BASE or BROAD indicates the type of signaling used, baseband or broadband. All of the popular media systems use baseband signaling, which means that the cable carries only Ethernet data and

signaling. A broadband media system carries multiple types of data and signaling. The final value identifies either the cable type or the maximum length of a cable segment. In more recently defined media systems, the value indicates the cable type. For example, in the identifier 10BASE-T, the T signifies twisted-pair cable. The maximum cable length per segment as specified by the standard is 100 meters, butEMBEDDED the identifier does not contain this 70 NETWORKS; UNIT III: Ethernet Basics information. In identifiers defined earlier in Ethernets history, the third value indicates maximum cable length. For example, in the identifier 10BASE-5, the maximum segment length is 500 meters. The media type is coaxial cable, but the identifier does not contain this information.

Media System 10BASE-T 100BASE-TX 1000BASE-T 10BASE-FL 100BASE-FX 1000BASE-SX 1000BASE-LX 10BASE-2 10BASE-5 Cable Type twisted pair, Category 3 or higher twisted pair, Category 5 or higher twisted pair, Category 5 or higher fiber optic, multimode fiber optic, multimode fiber optic, multimode fiber optic, multimode or single mode

thin coax thick coax Speed (Mb/s) 10 100 1000 10 100 1000 1000 10 10 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 71

Encoding: One of the characteristics specified by the media system is how the data is encoded for transmitting. The encoding method helps to ensure that the data reaches its destination without errors. The encoding defines what voltages or light levels correspond to different values. For some media systems, the encoding defines code symbols to represent groups of bits. The controller chips hardware handles the encoding and decoding. Block Encoding: Fast Ethernet and Gigabit Ethernet media systems use methods of block encoding. Block encoding groups bits to be transmitted into blocks that are typically 4 or 8 bits each, then converts each block into a set of bits called a code symbol. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 72 Block encoding can ensure frequent transitions in transmitted

data, to help in keeping the transmitting and receiving interfaces synchronized. Another advantage is the availability of additional code symbols. After assigning code symbols to all of the possible groups of bits, extra symbols remain. A protocol can specify any use for these, and typically uses the symbols to provide status or control information. A code symbol is longer than the bits it represents. In the 4B/5B block encoding used in Fast Ethernet, a 5-bit code symbol represents 4 data bits. Each code symbol contains one or more transitions. In the 8B/10B block encoding used in fiber-optic Gigabit Ethernet, a 10-bit code symbol represents 8 data bits. In both cases, the extra bits increase the maximum transition rate in the cable by 25 percent. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 73 In addition to ensuring that there are sufficient transitions,

8B/10B encoding attempts to maintain a DC balance by ensuring that the number of transmitted zeros is roughly the same as the number of transmitted ones over time. The encoding accomplishes this by assigning two possible code symbols to some 8-bit values, with the two symbols containing different numbers of zeros and ones. The transmitter maintains a disparity value that is a measure of the number of transmitted zeros versus ones over time. When the ratio of transmitted zeros to ones gets out of balance, the transmitter switches to the set of code symbols that will restore the balance. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 74 Transmitting the bits: The different media systems use different encoding methods in transmitting the data bits or code symbols that represent the data bits.

Ten-Mb/s systems use a method called Manchester encoding. In a logic 1, the signal is a low voltage or low light level for the First half of the bit period and a high voltage or high light level for the second half of the bit period. A logic 0 is the reverse: the signal is high for the first half of the bit period and low for the second half. The advantage to Manchester encoding is that it guarantees a transition in each bit, and this makes signals easy to synchronize to. The limitation is that the maximum rate of transitions is twice the bit rate, and hardware that can handle higher bit rates tends to be more expensive. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 75 In Fast Ethernet systems, the bits in a code symbol transmit using a method of encoding called multi-level transition 3, or MLT-3. Instead of specifying two voltage ranges that correspond to logic 0 and logic 1, MLT-3 uses three voltage

ranges. For each bit time, a change from one logic level to the next signifies a logic 1, while no change signifies a logic 0. The data in Fast Ethernet systems is also scrambled before transmitting to provide bit patterns that reduce electromagnetic emissions. In twisted-pair Gigabit Ethernet, instead of serially transmitting the bits in the code symbols, which would take five bit times, the transmissions use a system of 5-level pulseamplitude modulation. A code symbol is one of five defined voltage levels, and each level represents a 2-bit value. In this 76 EMBEDDED NETWORKS; UNIT III: Ethernet Basics way, two bits of data transmit in one bit time on each pair of With each transition representing two bits and four signal pairs transmitting at once, each bit time transmits 8 bits of information. Transmitting a Gigabit per second, the maximum transition rate is 125 transitions per microsecond, which is the same maximum transition rate as in Fast Ethernet. Fiber-optic segments for Fast Ethernet transmit the individual

bits in a code symbol using a method of encoding called nonreturn to zero, invert on ones (NRZI). A logic 0 results in no change in light level; if light transmitted during the previous bits time period, light continues to transmit for the logic-0 bit that follows. A logic 1 results in a change in light level: if light transmitted during the previous bits time period, light doesnt transmit for the logic-1 bit that follows, and if light didnt transmit during the previous bits time period, light does transmit for the logic-1 77 EMBEDDED NETWORKS; UNIT III: Ethernet Basics bit that follows. Gigabit fiber-optic segments transmit the individual bits in the code symbols using non-return-to-zero (NRZ) encoding. NRZ is the simplest encoding: light transmits to indicate a logic 1 and light doesnt transmit to indicate a logic 0. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

78 Twisted-pair Media Systems: The identifiers for popular twisted-pair media systems are 10BASE-T, 100BASE-TX, and 1000BASE-T. 10 BASE-T: Bit rate: 10 Mb/s. Cable Type: Category 3 (also known as telephone twisted pair) or higher. Category 5e or higher recommended. Connector Type: RJ-45. Maximum length of a cable segment: A 10BASE-T cable segment can be 100 meters or more. The main limiting factor for the cable is attenuation as signals travel through the cable and connectors. The maximum allowed attenuation is 11.5 decibels. The exact length limit varies with cables and components, but generally, a segment that uses cables and connectors rated as Category 3 or better should have no trouble transmitting 100 meters. Maximum number of transceivers per cable segment: 2. Encoding: Manchester. Comments: A workhorse for low-cost communications.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 79 100BASE-TX Bit rate: 100 Mb/s. Cable Type: Category 5 or higher. Category 5e or higher recommended. Connector Type: RJ-45. Maximum length of a cable segment: 100 meters Maximum number of transceivers per cable segment: 2. Encoding: 4B/5B block encoding. Comments: Also known as twisted-pair Fast Ethernet. 1000BASE-T Bit rate: 1000 Mb/s. Cable Type: Category 5 or higher. Category 5e or higher recommended. Connector Type: RJ-45. Maximum length of a cable segment: 100 meters. Maximum number of transceivers per cable segment: 2. Encoding: block encoding with pulse amplitude modulation. All four wire

pairs carry data at the same time. Comments: Also known as twisted-pair Gigabit Ethernet. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 80 Fiber-optic Media Systems The identifiers for popular fiber-optic media systems are 10BASEFL, 100-BASE-FX, 1000BASE-SX, and 1000BASE-LX. Below is basic information about each. 10BASE-FL Bit rate: 10 Mb/s Cable Type: multimode, 62.5/125 (recommended), 50/125 and other cables allowed. Connector Type: BFOC/2.5, also known as ST connectors. Maximum length of a cable segment, half duplex: 2000 meters (with two or fewer repeaters); full duplex: 5 kilometers. Cables under 5 meters may require filters or attenuators. Maximum number of transceivers per cable segment: 2.

Encoding: Manchester. Comments: Allows very long cable segments in half- and full-duplex modes. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 81 100BASE-FX Bit rate: 100 Mb/s Cable Type: 62.5/125 or 50/125 multimode. Connector Type: Low Cost Fiber Optical Interface Connectors (SC or 568SC type) recommended. BFOC/2.5(STtype) Media Interface Connector (MIC) also permitted Maximum length of a cable segment: half duplex: 412 meters; full duplex: 2 km. Maximum number of transceivers per cable segment: 2. Encoding: 4B/5B block encoding. Note: Full duplex allows very long segments. 1000BASE-SX Bit rate: 1000 Mb/s.

Cable Type: 62.5/125 or 50/125 multimode. Connector Type: Low Cost Fibre Optical Interface Connectors (SC type). Maximum length of a cable segment, half duplex: 220 to 316 meters, depending on cable type; full duplex: 220 to 550 meters, depending on cable type. Minimum: 2 meters. Maximum number of transceivers per cable segment: 2. Encoding: 8B/10B block encoding. Note: Because of the encoding, the maximum transition rate is 1.25 Gigabaud for a data rate of 1 Gigbit per second. This high rate requires the use of lasers as the light source. The SX in the name refers to a short-wavelength light source. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 82 1000BASE-LX Bit rate: 1000 Mb/s. Cable Type: 62.5/125 or 50/125 multimode or 10/125 single-mode. Connector Type: Low Cost Fiber Optical Interface Connectors (SC type). Maximum length of a cable segment, half duplex: 316 meters; full duplex: 5000 meters with single-mode fiber, 550 meters with multimode fiber. Minimum: 2

meters. Maximum number of transceivers per cable segment: 2. Encoding: 8B/10B block encoding. Note: Because of the encoding, the maximum transition rate is 1.25 Gigabaud for a data rate of 1 Gigabit per second. This high rate requires the use of lasers as the light source. The LX in the name refers to a long-wavelength light source. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 83 Coaxial-cable Media Systems: The identifiers for coaxial-cable media systems are 10BASE-5 and 10BASE-2. Below is basic information about each: 10BASE5 Bit rate: 10 Mb/s. Cable type: 50-ohm coaxial cable rated for use in 10BASE-5 networks, approximately 10mm in

diameter. Connector Type: Type N connectors (IEC 60169-16) or coaxial tap connectors. Maximum length of a cable segment, half duplex: 500 meters. Minimum 2.5 meters. Maximum number of transceivers per cable segment: 100. 84 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Encoding: Manchester. 10BASE-2 Bit rate: 10 Mb/s. Cable type: 50-ohm coaxial cable rated for use in 10BASE-2 networks, approximately 5mm in diameter. Connector Type: BNC. Maximum length of a cable segment, half duplex: 185

meters. Minimum 0.5 meter. Maximum number of transceivers per cable segment: 30. Encoding: Manchester. Note: Not recommended for new networks. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 85 Interfacing to Ethernet Controllers: The different cable types and speeds require different hardware interfaces to Ethernet Controller chips. The Ethernet standard defines several interfaces for connecting a computers Media Access Control (MAC) layer. This MAC layer manages sending and receiving of network data, to the physical layer which connects the components that are specific to cable type. Depending on cable type and network speed, the physical layer may contain little more than transceivers, some filtering, and a connector, or the layer may include circuits that encode and decode

data and convert between serial and parallel interfaces. Many Ethernet controllers have an on-chip interface for twistedpair cables and require only filtering circuits and a connection to an RJ-45 connector. The figure shown below shows some options for some cable connections. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 86 THERNET ONTROLLERS EMBEDDED NETWORKS; UNIT III: Ethernet Basics 87 In figure-a a 10-Mb/s controller uses an attachment unit interface (AUI) that connects to a media attachment unit (MAU) that in turn interfaces to the network cable.

The MAU is a separate unit that attaches to the controllers 15-pin AUI interface. The MAU provides an interface to an Ethernet connector, a collision-detect output, and jabberdetection (jabber means any device that is handling electrical signals improperly, usually affecting the rest of the network) circuits to prevent a malfunctioning interface from continuously transmitting. With an AUI, we can switch between coaxial, twisted-pair, and fiber-optic cable by swapping the MAU. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 88 In figure-b a 10- or 100-Mb/s Ethernet controller uses a medium-independent interface (MII) that connects to a physical layer device (PHY), which in turn connects to the network cable. The PHY may be on the same circuit board as the Ethernet controller or a separate unit. The MII converts between the networks serial data and a 4bit data bus that connects to the Ethernet controller. Some

Ethernet controller chips include a PHY core for twisted-pair interfaces. An Ethernet controller that includes an embedded PHY typically requires external filtering circuits between the PHY and network connector. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 89 In Figure C, a Gigabit Ethernet controller uses a Gigabit medium-independent interface (GMII) that connects to a Gigabit PHY, which connects to the network cable. Because of Gigabit Ethernets speed, the GMII cant use a cable to connect to the Ethernet controller, but must be on the same circuit board or a daughter board. The GMII converts between the network data and an 8-bit data bus that connects to the Ethernet controller. Another option for a Gigabit Ethernet controller used with

fiber-optic cable is a Ten-Bit Interface (TBI) (Figure D), which connects to a Gigabit PHY, which connects to the network cable. The TBI converts between the network data and a 10-bit data bus that connects to the Ethernet controller. Figure E shows an Ethernet controller that contains an embedded PHY for use with twisted-pair cable. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 90 Using Repeater Hubs, Ethernet Switches, and Routers: Ethernet networks have several options for interconnecting the computers in a network. Repeater hubs and switches have attachment points for two or more cables that can connect to other interfaces in a local network. Both repeater hubs and switches repeat, or regenerate, traffic received on one port to the other ports. A repeater hub repeats all traffic to all ports, with the exception of some multi-speed

repeater hubs that convert traffic between speeds only when necessary. A switch examines the destination of all received traffic and when possible, forwards the traffic only to the port on the path to the destination. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 91 NOTE: the Ethernet standard uses the terms repeater hub and switching hub to distinguish between the two device types. However, in popular use, hub by itself generally refers only to repeater hubs, while switch refers to switching hubs. To prevent confusion, term repeater hub is considered as the standard term but avoids using switching hub in favor of switch or Ethernet switch. Repeater hubs and switches make it easy to add and remove network interfaces. Each repeater hub or switch has multiple ports. To add an interface, the interfaces cable is to be

attached to an available port on the repeater hub or switch. With most media systems, we can add more ports by connecting additional repeater hubs or switches to available ports on existing repeater hubs and switches. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 92 Communicating with other networks, including the Internet, requires an additional piece of equipment: a router. For Internet communications, a local computer may connect via a modem to a router at an Internet Service Provider. Repeater Hubs: A repeater hub can connect multiple interfaces and helps to ensure reliable communications by detecting collisions, regenerating missing preamble bits, and blocking traffic from failed interfaces. The IEEE 802.3 standard specifies the functions of repeater hubs that support a single speed but doesnt forbid (refuse to allow)

hubs that support multiple speeds. On receiving traffic from an interface, the repeater hub repeats the traffic, passing it to each of the other attached interfaces. In a network that uses repeater hubs, each interface sees all of the 93 EMBEDDED NETWORKS; UNIT III: Ethernet Basics traffic from the other interfaces, with two exceptions. Connecting Interfaces: Ethernet cable segments have maximum permitted lengths, depending on the media system. Repeater hubs enable increasing the distance between interfaces by connecting two or more segments in series. The hub regenerates the signals, enabling them to travel farther than the maximum length of a single segment. Along with the data it receives, a repeater hub also detects and responds to collisions and prevents traffic from misbehaving interfaces from reaching the other interfaces in the network. When two or more interfaces try to transmit at the same time,

the transmitting interfaces have to be able to detect the collision before the number of bits in a minimum-size frame has transmitted. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 94 When a repeater hub increases the distance between interfaces, the time it takes for signals to travel from one end of the network to the other increases as well. This longer travel time means that it can take longer for a transmitting interface to detect a collision. So to ensure that interfaces can detect collisions in time, repeater hubs must detect collisions and on detecting a collision, send a jam signal to all attached interfaces. A repeater hub also extends received frame fragments when necessary by adding alternating 1s and 0s to the end of the fragment. A repeater hub cuts off traffic from a failed interface or

network segment so the rest of the network can continue to operate normally. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 95 The hub stops repeating an interfaces traffic if the port has either a large number of collisions or collisions that persist longer than normal. When the hub is no longer repeating the traffic from an interface, the offending interface is said to be partitioned from the rest of the network. Meanwhile, the rest of the network can communicate. After partitioning an interface, a repeater hub continues to attempt to send traffic to the interface. If the interface begins working properly again, the hub resumes repeating traffic from the interface. In a similar way, a repeater hub also cuts off communications with an interface that is jabbering, or continuing to transmit longer than the maximum time allowed for a frame.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 96 How many repeater hubs: In addition to limiting the length of cable segments, the IEEE 802.3 standard limits the number of repeater hubs allowed between two interfaces. The two factors that determine the maximum number of repeater hubs and the maximum length of cable segments are the interframe gap, or time between frames, and the round-trip propagation delay, or how long it takes a bit to travel the length of the network and back. As cable length increases, the time required for a bit to travel the length of the network increases, so the time required to detect a collision in the worst case increases as well. Also, the interframe gap may shrink as signals pass through repeater hubs. If for any reason a repeater hub doesnt receive all

of a frames Preamble bits, the hub regenerates the bits when it repeats the frame, and these added bits shorten the gap between the current and next frames. 97 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The maximum number of repeater hubs varies with the media system. For 10BASE-FL networks, adding repeaters can also shorten the maximum allowed segment length. Ethernet switches, (going to be described later), can extend a network beyond whats possible with repeater hubs. The IEEE 802.3 standard provides two transmission-system models to use as guides in configuring a system that meets the requirements. Model 1 specifies maximum numbers of repeater hubs and maximum segment lengths for different media systems. Guidelines in Model 1: In a 10BASE-T or 10BASE-FL network, the transmission path between two interfaces may contain up to five segments and

four repeater hubs. A network may have more than four repeater hubs as long as the path between any two interfaces 98 EMBEDDED NETWORKS; UNIT III: Ethernet Basics has no more than four repeater hubs. A 10BASE-FL network has additional restrictions on segment length in some configurations. With two or fewer repeater hubs, the maximum segment length is 2000 meters. With three repeater hubs, the maximum segment length between repeaters is 1000 meters, and the maximum distance between a repeater hub and an interface is 400 meters. With four repeater hubs, the maximum length of each segment is 500 meters. So using repeater hubs, the maximum distance between interfaces in a 10BASE-FL network is 6000 meters, using two repeaters hub and three 2000-meter segments. In a 100BASE-TX or 100BASE-FX network, a transmission path between two interfaces can have one Class I repeater hub or up to

two Class II repeater hubs. A Class I repeater hub converts as needed between encoding methods. A network that contains only 100BASE-TX and 100BASE-FX interfaces doesnt need converting because both media systems use the same encoding. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 99 In a 1000BASE-TX or 1000BASE-FX network, a transmission path between two interfaces can have only one repeater hub. Virtually all Gigabit Ethernet systems use switches instead of repeater hubs. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 100 Auto-negotiating: With the addition of 10-Gb/s Ethernet, an Ethernet interface

can support up to four speeds, as well as half duplex and full duplex communications. The IEEE 802.3 standard defines a protocol for autonegotiating that enables an interface to automatically use the fastest speed and duplex mode available without requiring manual configuring in hardware or software. When two interfaces that support auto-negotiating connect to each other, they exchange a series of handshaking signals to determine the fastest configuration supported by both. When an interface that supports auto-negotiating connects to an interface that doesnt support auto-negotiating, the autonegotiating interface detects and matches the speed and duplex mode of the other interface. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 101 To use auto-negotiating, the Ethernet interfaces hardware must support the protocol and auto-negotiating must be enabled, typically in configuration registers, and supported by the Ethernet controllers driver software.

Crossover and Straight-through Cables For all Ethernet media systems except twisted-pair Gigabit systems, each interface has a dedicated pair of wires or a fiber strand for communicating in each direction. When a computer transmits on the network, the transmitting wires or fibers need to be routed to the receivers on the receiving computers. For twisted-pair media systems, the repeater hub or switch normally performs the crossover. The interfaces that connect to the repeater hub or switch transmit on pins 1 and 2 and receive on pins 3 and 6. The repeater hub or switch routes data received on pins 1 and 2 to pins 3 and 6 at the hub or switchs ports. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 102 If we want to add ports or extend a 10/100 Mbps network then this can be done by using two repeater hubs or switches in series.

If the first devices port transmits on pins 3 and 6 and the second devices port expects to receive on pins 1 and 2, a connection between the devices requires a crossover cable. An alternative is to use the uplink port available on many repeater hubs and switches. An uplink port is identical to the devices other ports except that it doesnt have an internal crossover. If two repeater hubs or switches are connected using an uplink port on one of the devices, a straight-through cable can be used. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 103 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 104 EMBEDDED NETWORKS; UNIT III: Ethernet Basics

105 Multi-speed Repeater Hubs An enhancement to the single-speed repeater hub is the multispeed hub, which can connect interfaces of different speeds. A popular type of multi-speed repeater hub supports 10BASE-T and 100BASE-TX media systems. The ports typically configure themselves automatically for the speed of an attached interface. A multi-speed repeater hub contains a repeater hub for 10 Mb/s and a repeater hub for 100 Mb/s, with an internal switch that connects the hubs. Most multi-speed repeater hubs convert between speeds only as needed. In the figure shown below, the interfaces at ports A, B, and C are 10 Mb/s and the interfaces at ports D, E, and F are 100 Mb/s. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 106

A MULTI SPEED HUB EMBEDDED NETWORKS; UNIT III: Ethernet Basics 107 If the interface at port A sends a frame to the interface at port B, the repeater hub may detect that the frame is destined for a 10Mb/s interface and thus may decide not to convert and pass the traffic on to ports D, E, and F. If the interface at port A sends a frame to the interface at port D, the repeater hub must do the conversion. Ethernet Switches Like a repeater hub, an Ethernet switch provides attachment points for connecting interfaces to a network. A switch can do all the functionalities that a repeater hub can do with an advantage. Instead of sending all frames to all ports, a switch examines each received frame and if possible, sends the frame only to the port that connects directly to the frames destination or to a repeater

hub, switch, or router on the way to the destination. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 108 Switches generally cost little more than repeater hubs and can improve network performance by isolating some of the network traffic. The benefits of Ethernet switches can be understood by the concept of collision domain which consists of all the interfaces connected either via repeater hubs or on the same segment of coaxial cable. If two interfaces in a collision domain try to transmit at the same time, a collision results and both must retry later. On a switch, each port is in a separate collision domain, so the interfaces connected to one port dont see traffic between the switchs other ports. In many networks, the multiple collision domains provided by switches result in a less congested network. Consider the figure

shown below. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 109 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 110 When Interface 1 sends a frame to Interface 2, Repeater Hub 1 repeats the frame to interfaces 2 and 3 and to Port A on the switch. If the switch determines that the destination interface is available from Port A, the switch doesnt send the frame out Port B or C. Interfaces 47 dont see the frame and are free to exchange other traffic. If Interface 4 and Interface 7 both attempt to send a frame at the same time to Interface 1, neither interface sees a collision. The switch receives the frames on its Port B and Port C and

forwards the frames in sequence out Port A. On receiving a frame, a switch uses the frames destination address to decide where to send the frame. To make this decision, the switch has to know which ports correspond to which addresses. 111 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The IEEE 802.1D standard defines a way for an Ethernet switch to learn recently used addresses without requiring any user setup or configuring. The switch learns addresses by reading the source address of every frame it receives. The switch stores these addresses in a table, with each entry containing the source address, the port that received the frame, and when the switch received the frame. In some cases, the source address will match the address of one of the interfaces that connects directly or via a repeater hub to one of the switchs ports. In other cases, the source address will be for an interface that is one or more switches or repeater hubs

away. When a frame arrives, the switch looks for a match between the frames destination address and the addresses in the switchs table. On finding a match, the switch sends the frame only to the designated port. If there is no match, the switch sends the frame 112 EMBEDDED NETWORKS; UNIT III: Ethernet Basics to all of its ports, in a process called flooding. To keep the table from overflowing, the switch removes entries that have had no recent traffic. A switch may also connect interfaces of different speeds. On a typical switch, the ports use auto-negotiation to automatically configure themselves to support the speed of an attached interface. Handling Traffic Because each port on a switch has its own collision domain, a switch may at times receive more traffic than it can handle right away.

For example, if two ports on a switch each receive a frame destined for a third port, the switch can only transmit one frame immediately, and must store the other. Switches contain buffer memory for this purpose. When the buffer is full, the switch drop the frames or ignore the frames that it cannot handle. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 113 The IEEE 802.1D standard doesnt specify a way to notify the sending interface when a frame is dropped. If the sending interface needs to know that the data arrived at its destination, the sender can use a higher-level protocol such as TCP, which requires the receiver to return an acknowledgment on receiving a frame. How Many Switches? The IEEE 802.1D standard recommends a maximum of seven switches between interfaces, to limit the total time required for

a transmission to reach its destination. In practice, messages that use the Internet Protocol (IP) are likely to get to their destinations even if there are more witches between the interfaces. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 114 Routers A router can do everything an Ethernet switch can do, including providing attachment points for interfaces and forwarding traffic. But an Ethernet switch can only work with Ethernet frames. If users Ethernet network wants to communicate with a different kind of network, or with another Ethernet network, or over the Internet, a router can provide access beyond the local network. Another term for a router is gateway. When a computer with an Ethernet interface wants to send a message on the Internet, the computer places the message in an

Ethernet frame and sends it to a router that can communicate on the Internet. The router does what is needed to send the message toward its destination. In the opposite direction, the router receives messages from the Internet and sends them in Ethernet frames 115 EMBEDDED NETWORKS; UNIT III: Ethernet Basics onto the local network. Messages that travel on the Internet uses the Internet Protocol to identify the receiving interface. An Ethernet frames data field can contain an IP datagram. When a router receives an Ethernet frame from the local network, it looks inside the IP datagrams header in the frames data field to read the destinations IP address. Like switches, routers maintain tables of recently used addresses and where to route traffic to them. For an unfamiliar address, the router sends the data to a designated default router.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 116 DESIGN CHOICES INTRODUCTION: When a user is ready to begin designing an embedded system for networking, user will need to make some decisions about the device hardware and the programming code that will control the hardware. At one extreme, user can do it all on his/her own, interfacing an Ethernet controller chip to a CPU and writing code to support Ethernet communications and the Internet protocols the device uses. A lot of time can be saved by starting with a module that contains a CPU, Ethernet interface, and software support for Ethernet communications and Internet protocols. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

117 Or user can choose a middle path, such as using a provided software library but designing your own circuits. Every computer in an Ethernet network must have an Ethernet controller, and there are choices to select the controller. Selecting Components: On the software side, both C and Java are popular languages for programming networked embedded systems. If a user has experience in one of these languages then the user can write his/her own code. On the hardware side the user should have a better experience with any one of the processors (CPU). EMBEDDED NETWORKS; UNIT III: Ethernet Basics 118

Complete Solutions: Some products are complete solutions that provide both the hardware and program code for Ethernet and Internet communications. The hardware typically includes a circuit board with a CPU, Ethernet controller, and related components. The program code includes support for Ethernet, TCP/IP, and other Internet protocols. Different products use different CPUs, and the type and amount of memory and I/O options vary. A product may support programming in assembler, C, Java, or a combination of languages. Some circuit boards are suitable for use in projects as-is, while others are designed mainly as development systems for projects that will eventually be moved to a project-specific circuit board. 119 EMBEDDED NETWORKS; UNIT III: Ethernet Basics

Some products may require additional investments in programming hardware and debugging tools, while others include these or enable using free software tools. Here the two popular modules that provide complete solutions have been considered. They are Rabbit Semiconductors RCM 3200 Rabbit Core C-programmable Module with Ethernet and Dallas Semiconductors DSTINIm400 Networked Microcontroller Evaluation Kit. Rabbit Semiconductor RCM3200 This semiconductor consist of a fast Z-80 with plenty of I/O, low EMI (Electromagnetic Interference is a disturbance generated by an external source that affects an electrical circuit by electromagnetic induction), and a complete development system, including a C compiler. Ethernet support: 10BASE-T and 100BASE-TX. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

120 Hardware: The RCM3200 RabbitCore C-programmable Module with Ethernet is a circuit board that contains Rabbit Semiconductors Rabbit 3000 microprocessor, which is a much improved and enhanced derivative of ZiLOG, Inc.s venerable Z80 microprocessor. The circuit board is smaller than a business card and supports a variety of I/O interfaces. Rabbit Semiconductor EMBEDDED NETWORKS; UNIT III: Ethernet Basics 121 The circuit board is smaller than a business card and supports a variety of I/O interfaces.

The Rabbit 3000 microprocessor has seven 8-bit I/O ports. Many of the bits can have special functions, including six serial ports for asynchronous and synchronous communications and Infrared Data Association (IrDA) protocols, a bidirectional parallel port, two input-capture channels, four pulse-widthmodulation (PWM) outputs, and two quadrature decoder units with inputs for optical incremental encoder modules. In addition to the I/O ports, there is an external memory bus with 8 data bits and 20 address lines. The power supply can range from +3.6V to as low as +1.8V. A counter that functions as a real-time clock has a separate power pin to make it easy to provide battery backup. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 122 The chip is available in a 128-pin LQFP (low profile quad flat pack) or 128-ball TFBGA (thin-profile fine-pitch ball grid array) package. The Rabbit 3000 is an obvious choice for systems that must

obtain Federal Communications Commission (FCC) certification or comply with other regulations that limit electromagnetic interference (EMI). The chips designers have gone to great lengths to create a CPU whose internal architecture and external interfaces make it easy to design systems that pass EMI tests. The Rabbit 3000 also has several features for applications that must conserve power. Lowering the supply voltage can reduce power consumption by 75 percent. Slowing the clock reduces power consumption as well. The CPU can switch between a fast clock (up to 54 Megahertz) and a second clock that can run at 32 kilohertz. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 123 The CPU can use the slow clock while waiting for a specified time to elapse or an event to occur, then switch to the faster clock when processing power is needed.

With a low supply voltage and a slow clock, current consumption can be as low as a few hundredths of a milliampere. The RCM3200 module contains a Rabbit 3000 clocked at 44.2 Megahertz along with memory and components to support Ethernet communications. There are 512 kilobytes of Flash memory for storing programs, 512 kilobytes of fast RAM for loading code for execution, and 256 kilobytes of RAM for storing data. One of the serial ports uses a special programming cable to load firmware from a PC into RAM or Flash memory. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 124 The modules Ethernet controller is an ASIX AS88796 3-in-1 Local Bus Fast Ethernet Controller, which interfaces to the CPUs external data bus. The module has an RJ-45 connector for 10BASE-T and

100BASE-TX Ethernet media systems. Two headers on the bottom of the board provide access to the I/O bits and other signals. The RCM3200s development kit includes an RCM3200 module and a prototyping board with a power-supply connector, a voltage regulator, a prototyping area, and switches and LEDs for experimenting. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 125 RCM3200 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 126 The RCM3200 is one of several modules offered by Rabbit

Semiconductor. If suppose the user dont need the speed of 100BASE-TX, then the user can consider RCM2100 module which supports only 10BASE-T Ethernet. The RCM2100 contains a Rabbit 2000 microprocessor, a slower but still very serviceable CPU with the same instruction set at the Rabbit 3000. The modules Ethernet controller is a Realtek RTL8019AS Full Duplex Ethernet Controller. Software: Rabbit Semiconductors Dynamic C is a complete environment for writing and editing code, compiling and linking, loading compiled code into the RCM3200s RAM or Flash memory, and debugging. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 127 Rabbit Semiconductors Dynamic C

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 128 For networking, Dynamic C includes drivers for the Ethernet controller and libraries that support TCP/IP communications and other networking protocols. The libraries provide support for an HTTP server, an FTP client and server, and sending and receiving e-mail with SMTP and POP3. A file system supports storing information in files in Flash memory or battery-backed RAM. Additional library modules are available, including a module that implements the open-source, real-time MicroC/OS-II operating system. An Advanced Encryption Standard (AES) module supports encrypting network data using the Rijndael Advanced Encryption Standard cipher. Other modules support the Point-to-Point protocol (PPP) and Simple Network Management Protocol (SNMP). EMBEDDED NETWORKS; UNIT III: Ethernet Basics

129 Two code modules perform basic functions for all Dynamic C programs. Compiled code automatically includes the Virtual Driver module, which performs initialization and timer functions. The Rabbit BIOS is compiled separately and handles startup, shutdown, debugging communications, and other basic tasks. Dynamic C loads the BIOS into the RCM3200s memory automatically using the Rabbit 3000s bootstrap mode and programming cable. Dynamic C has built-in support for multitasking for tasks that each require CPU time on a regular basis. A system may use cooperative or preemptive multitasking. In cooperative multitasking, the tasks must agree to cooperate to not use more than their share of processor time. Dynamic C achieves cooperative multitasking through the use of costatements and co-functions. 130

EMBEDDED NETWORKS; UNIT III: Ethernet Basics A co-statement is a list of statements with a pointer that keeps track of which statement to execute next. A co-statement typically functions as one statement in a list of statements that execute in sequence in a loop. Within a co-statement, a waitfor control statement can test to find out if a function has completed or a timeout has occurred. If waitfor returns true, the co-statement continues with the next statement in the list. If waitfor returns false, the costatement jumps to its closing brace. The next time the co-statement executes, the co-statement begins at the waitfor that previously returned false. In this way, the code can make its way through a series of statements without being blocked by a statement that takes a long time to execute. A waitfor statement can call any function that returns a value. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 131

Example: for(;;) { tcp_tick(NULL); costate { //wait DelaySec seconds between sends. waitfor(DelaySec(1)); //send a datagram to the remote host. send_datagram(); } } EMBEDDED NETWORKS; UNIT III: Ethernet Basics 132 The first time the co-statement executes, the

waitfor(DelaySec(1)) statement executes and saves a value that indicates the current time. The statement returns false and execution jumps to the costatements closing brace, then to the top of the for loop. Each time through the loop, waitfor(DelaySec(1)) executes, returning False until one second has elapsed. On returning true, execution continues with the send_datagram() statement. This statement calls the applications send_datagram() function, which sends a datagram to a remote host. Program execution then loops back to the waitfor() statement, which restarts the delay timing. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 133 Dynamic Cs co-functions are similar to co-statements, but can accept and return arguments. Co-statements and co-functions are convenient for many applications, but its also possible to achieve cooperative multitasking with state-machine based programming.

State machines can be useful when the program code repeatedly performs a series of tasks, but not always in the same order. A C switch statement can implement a state machine. For example, a TCP server can use a switch statement to decide what code to execute depending on the current state of a connection. Possible states might be initializing a socket, waiting for a connection, receiving a request, receiving headers, sending a response, and waiting to close a connection. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 134 In preemptive multitasking, each task is guaranteed processor time. Theres no need to depend on the other tasks to yield. Dynamic Cs slice statement enables preemptive multitasking by running a task for a time slice, or period, measured in units of 1/1024 second. At the end of the slice, the task suspends.

If all of the tasks in a programs main loop use slice statements, the user can determine how often each task receives its slice from the total number of slices. A limitation to using slices with TCP/IP communications in Dynamic C is that all TCP/IP functionality must take place in a single slice. The MicroC/OS-II library module provides another way to achieve preemptive multitasking. Another programming option for Rabbit modules is the WinIDE Integrated Development Environment from Softools, 135 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Inc. Like Dynamic C, WinIDE includes an editor, a compiler and linker, the ability to load compiled code into RAM or Flash memory, and a debugger. The Control Cross C compiler is a full Standard C compiler. Compiled code is smaller and faster than code compiled with Dynamic C.

Dallas Semiconductor DSTINIm400 (TINI): Basic introduction: A fast microcontroller with an enhanced 8051 architecture, plenty of I/O, an operating system, and a Java virtual machine (JVM). Ethernet support: 10BASE-T, 100BASE-TX Typical Uses: applications that need speed, lots of I/O, or a CAN interface. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 136 Hardware: TINI stands for Tiny Inter Net Interface. Technically, the TINI isnt a CPU or a circuit board, but a platform that consists of a CPU and related components, support for networking, and a Java runtime environment. The DSTINIm400 Networked Microcontroller Evaluation Kit is a module that implements the TINI platform. The modules

circuit board contains a Dallas Semiconductor DS80C400 Network Microcontroller which is a much enhanced, highspeed derivative of Intel Corporations long-popular 8051 microcontroller. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 137 DSTINIm400 Networked Microcontroller Evaluation Kit EMBEDDED NETWORKS; UNIT III: Ethernet Basics 138 The high speed comes from a fast clock and the ability to execute instructions in fewer clock cycles than an 8051. The maximum clock speed is 75 Mhz. To decrease EMI, the chip can use a slower clock with an on-chip clock multiplier. The 80C400 contains over 9 kilobytes of RAM and can

address 16 Megabytes of external memory. The chip has eight 8-bit I/O ports. Many of the port bits can function as data and address lines for an external memory bus with 8 data bits and 22 address bits. Most of the other port bits have alternate functions. There are three asynchronous serial ports and a programmable output clock for an Infrared Data Association (IrDA) interface. A 1-Wire-net Master can control communications on a 1-Wire net, or MicroLAN, which connects components 139 EMBEDDED NETWORKS; UNIT III: Ethernet Basics using a single data line plus a ground line. A Controller Area Network (CAN) 2.0B controller enables communicating over a CAN network, which is a serial interface and protocol thats popular in automotive, industrial, and medical applications. The 80C400 chip includes a programmed 64-kilobyte ROM that contains three firmware components. A networking stack

supports TCP/IP and related protocols, including IP version 6. A preemptive task scheduler enables sharing CPU time among multiple tasks. For remote storage of firmware and easy firmware upgrades, the NetBoot component enables the TINI to automatically locate, load, and run program code from the local network or the Internet. The chip also contains hardware support for Ethernet, including an Ethernet controller for 10-Mb/s and 100-Mb/s networks. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 140 The DS80C400 chip requires a +1.8V Core Supply Voltage and a +3.3V I/O Supply Voltage. The DSTINIm400 module requires a +3.3V source and contains a regulator to provide +1.8V to the 80C400. For connecting to external circuits, the module has a 144contact SODIMM (Small Outline Dual In-line Memory Module) connector with connections to the address and data

lines, other signals, and power pins. On the DSTINIm400 module, additional memory includes two Megabytes of Flash memory for program code and one Megabyte of battery-backed RAM. A DS1672 Low-Voltage Serial Timekeeping Chip contains a 32-bit counter that counts seconds for use as a base for a realtime clock. 141 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The DS2502-E48 is a 1-Wire Add-Only Memory chip that contains a factory-programmed, write-protected Ethernet hardware address. The remaining bytes in the 1-kilobyte chip are available for storing information that will never or seldom change. A MAX1792 low-dropout linear regulator provides 1.8V for the 80C400s Core Supply Voltage input. Two MAX6365 Supervisory Circuits and a 3V lithium battery provide battery backup for the RAM chips. For project development, the DSTINIs400 Sockets Board

Evaluation Kit (shown in the figure below) is a circuit board with components and connectors that make it easy to communicate with the DSTINIm400 module. The module plugs into a SODIMM socket on the board. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 142 DSTINIs400 Sockets Board Evaluation Kit EMBEDDED NETWORKS; UNIT III: Ethernet Basics 143 On the DSTINIs400, an Intel LXT972A Fast Ethernet Transceiver and filtering circuits provide an interface between the DS80C400s MII and an RJ-45 jack that can connect to a 10BASE-T or 100BASE-TX network. A MAX560 +3.3V Transceiver provides a TIA/EIA-562compatible interface for two of the 80C400s serial ports.

TIA/EIA-562 is similar to TIA/EIA-232 (also known as RS232), but with smaller minimum voltage swings. The minimum outputs for a TIA/EIA-232 interface are 5V, while TIA/EIA-562 requires just 3.7V. Over short distances, TIA/EIA-562 interfaces can connect directly to TIA/EIA-232 interfaces with no problems. The DSTINIs400 board includes DB-9 connectors for these ports. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 144 For interfacing to the 80C400s CAN controller, the DSTINIs400 has a CAN transceiver with connections to a header. Another header connects to two 80C400 port bits that can function as an I2C interface for synchronous serial communications. A DS2480B Serial Port to 1-Wire Interface Bridge enables using serial port 1 on the 80C400 to communicate with 1-Wire devices. The board includes solder pads for a Xilinx XC2C64 CoolRunner II complex programmable logic device (CPLD). The CPLD interfaces to the 80C400s data and address buses and adds 48 I/O bits that

are brought out to headers on the board. The board requires a regulated +5V supply. A MAX1692 Stepdown Regulator on the board provides a +3.3V supply for the DSTINIm400 and other components. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 145 The 80C400s predecessor is the 80C390, a slower and lessfull-featured but still very powerful chip. The DS-TINI-1 module contains an 80C390, Flash memory, and batterybacked RAM. A 72-contact Single In-line Memory Module (SIMM) connector provides access to the address and data buses, Ethernet signals, port bits, and other signals. For Ethernet communications, the module has Standard Microsystems Corporation (SMSC)s LAN91C96 Ethernet controller. A Maxim DS2433 EEPROM with a 1-Wire interface stores the Ethernet hardware address. An advantage of the DS-TINI-1 is that the complete Ethernet interface, except for the RJ-45 connector, is on the module,

while the DSTINIm400 module requires an external Ethernet 146 EMBEDDED NETWORKS; UNIT III: Ethernet Basics transceiver. The 80C390 doesnt contain a programmed ROM, but uses external Flash memory to store a bootstrap loader and runtime environment as well as application programs. Dallas Semiconductor isnt the only source for TINI hardware. Systronix (www.systronix.com) also produces many sources for TINI hardware. The TStik ( shown in the figure below) is a DS80C400 module that uses the same SIMM connector as the DS-TINI1. Unlike the DSTINIm400, the TStik includes an Ethernet transceiver and filtering circuits, so there is no need to provide these on a separate board. Two editions of the TStik are available, with and without an external memory bus. Systronix also offers a variety of development boards for use with the DS-TINI-1 and TStik. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

147 TINI Software Developers Kit (SDK) EMBEDDED NETWORKS; UNIT III: Ethernet Basics 148 The Software: The TINI Software Developers Kit (SDK), available for free which can be downloaded from the Dallas Semiconductor website includes the TINIOS operating system and a Java Virtual Machine (JVM). The operating system enables running multiple tasks by scheduling the tasks in time slices. The operating system supports a file system and includes memory and I/O managers. The JVM contains an interpreter that executes Java programs

and communicates with the operating system. Every Javacapable computer must have a JVM. The DSTINIm400s JVM uses about 40 kilobytes of memory. Two useful programs for use in developing TINI applications are the JavaKit utility available from Dallas Semiconductor and a Telnet application. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 149 The JavaKit utility runs on a PC and communicates over a serial-port link with a TINI (shown in the figure below). EMBEDDED NETWORKS; UNIT III: Ethernet Basics 150 Typing e at the JavaKit prompt causes the TINI to start its JVM and run the slush command shell (one of the command shells). After logging on with a user name and password, you can use slush commands to run programs, view directories, and execute commands such as ipconfig, which can set a static IP

address or specify that the TINI should use DHCP to receive its IP address. When the TINI has been configured for network communications, user can log onto slush over the network using a Telnet application such as Windows HyperTerminal. To use Hyperterminal for a Telnet session, set up the connection to connect to the TINI using TCP/IP. A startup file in the TINIs /etc directory canBasicsname 151 EMBEDDED NETWORKS; UNIT III: Ethernet applications to run when slush starts. Java programs for TINI can access the standard core Java packages java.lang, java.io, java.net, and java.util. The TINI implements most of the JDK version 1.1.8 distribution. The TINI also supports a series of TINI-specific classes.

Several of the classes relate to networking. The TININet class sets and gets network parameters such as the Ethernet address, IP address, and subnet address. The HTTPServer class implements a basic Web server. The DHCPClient and DNSClient classes enables the TINI to use DHCP and the DNS protocol. The HTTPServer class only supports Web pages with static content. To function as a Web server that serves dynamic content, the TINI can use additional software such as the Tynamo Web server from Shawn Silverman or Smart Software Consultings TiniHttpServer. Both of these include support for Java servlets. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 152 NOTE: To compile Java programs, user can use just about any Java compiler and Java development system, including the compiler in the free Java Development Kit (JDK) from Sun Microsystems (java.sun.com). Borlands Jbuilder environment (www.borland.com) includes a compiler and graphical interface for developing. JBuilder comes in several editions, including a

free Personal Edition. After compiling a .java file to a .class file, an additional step creates the binary file required by the TINI. The TINI Convertor utility converts .class files to .tini files, which contain the byte codes, or machine instructions, that the TINIs JVM interprets. A .tini file is essentially the same as a .class files, but with redundant information removed for a smaller file size. To copy .tini files from a PC to a TINI, user can use any generic 153 EMBEDDED NETWORKS; UNIT III: Ethernet Basics FTP client program configured to access the TINIs IP address. NOTE: Dallas Semiconductor and Maxim Integrated Products grant users a no-charge license to load the binary file containing the code into a TINI system. Although the TINI was created as a Java computer, its possible to program the DSTINIm400 in C or assembly code using Keil Softwares uVision2 C compiler.

Systronix Jstik Ethernet support: 10BASE-T Typical use: Applications that use Java and require speed. Hardware. The TINI is not the only option for Java programmers. Systronixs JStik board (shown in the figure below) contains aJ-100 microcontroller from aJile Systems Inc. The aJ-100s native execution of Java bytecodes results in very fast performance . The chip is based on the JEM 154 EMBEDDED NETWORKS; UNIT III: Ethernet Basics processor developed at Rockwell Collins. The JStik adds a high-speed I/O bus that can operate at bursts of 50 Megabytes per second, two RS-232 ports, and SPI and I2C interfaces. The board fits into a 60-contact SIMM socket and has an RJ-45 plug and additional I/O connectors. Software: Systronix provides aJiles Jem Builder tool and Charade

debugger for building, loading, and testing applications. You can use other Java environments and tools with the JStik as well. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 155 Netburner MOD5282 Processor Module This processor supports Fast Ethernet and a fast 32-bit CPU with lots of memory and I/O. Ethernet support: 10BASE-T and 100BASE-TX Typical use: Applications that need speed and abundant resources. Hardware: Netburners MOD5282 Processor Module contains Motorolas 32-bit ColdFire MCF5282 processor. The MCF5282 supports a subset of the Motorola 68000 CPUs instruction set. The chip has 512 kilobytes of Flash memory and 64 kilobytes of RAM. For I/O interfacing, the MCF5282 has three UARTS, a CAN

interface, an I2C controller, a queued serial peripheral interface (QSPI) for synchronous serial communications, and an 8-channel, 10-bit analog-to-digital converter. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 156 The chip is in a 256-pin mold array process ball-grid array (MAPBGA) package that contains the media-access control circuits for 10BASE-T and 100BASE-TX Ethernet in addition to the CPU. The MOD5282 includes 8 Megabytes of SRAM and connections for a 16-bit data bus and 16-bit address bus. For networking, the board includes a PHY for 10-Mb/s and 100-Mb/s Ethernet and an RJ-45 connector. Applications are compressed and stored in Flash memory. At startup, the application loads into and runs from RAM. The Module 5282 Development Kit contains a MOD5282 board, a power supply, connectors, and other components for prototyping and testing.

Module 5282 Development Kit contain software support for Ethernet and Internet protocols, an operating system based on the freeware m for the core and 125 m for the C/OS, the freeware GNU C/C++ compiler, a debugger, and configuration utilities. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 157 The software supports TCP/IP, and related protocols, including code that enables NetBurner modules to function as Web servers and to send and receive e-mail. Microchip Technology PICDEM.net Board Ethernet support: 10BASE-T Demonstration Hardware: The PICDEM.net Demonstration Board contains a microcontroller, Ethernet controller, related components, and a bread boarding area. The board is intended mainly for developing and testing, rather than as a plug-in module for use in a product.

The microcontroller is a PIC16F877, a member of Microchip Technologys popular PIC Micro family The PIC16F877 has Flash memory that can store 8192 14-bit words, 368 bytes of 158 EMBEDDED NETWORKS; UNIT III: Ethernet Basics RAM, and 192 bytes of EEPROM. There are 33 I/O bits. Many of the bits have alternate functions, including an eight-channel, 10-bit analog-to-digital converter, an asynchronous serial port, a synchronous serial port, and a parallel interface. The clock speed is 19.6608 Megahertz. The microcontroller is in a 40-pin DIP socket, and can be replaced by other members of the PIC family, including the PIC18C452 and PIC18F452. The board also contains a 32-kilobyte serial EEPROM for storing Web pages the microcontroller will serve. For experimenting, the board provides LEDs, a pushbutton, potentiometers, and an LCD module.

The Ethernet controller is a Realtek RTL8019AS. The interface to the controller uses the CPUs parallel port and 159 EMBEDDED NETWORKS; UNIT III: Ethernet Basics five additional I/O bits. For loading programs, there is a connector for use with Microchips MPLAB In-Circuit Debugger, which can program the microcontrollers Flash memory. The user can use the serial port and a terminal emulator such as Windows HyperTerminal to load network configuration information into the EEPROM. Special Purpose Modules: In addition to products that provide a complete generic system for networking, a variety of modules and chips are available to handle specific tasks. Some products can interface to just about any CPU. If user has an existing product or a CPU that he/she want to use, one of these modules may provide a way to add

networking capability. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 160 Lantronix Device Server: This device enables any device with an asynchronous serial port to communicate over a network. Ethernet support: 10BASE-T, 100BASE-TX. Hardware: Lantronix offers its Device Servers in a variety of packages, including devices in enclosures, circuit boards and chips for incorporating into other devices, and a server squeezed into a slightly extended RJ-45 connector. Each server has a TTL-compatible asynchronous serial port for communicating with an external device or system and an RJ-45 connector for connecting to an Ethernet network. Firmware is stored in Flash ROM. The CPU varies depending on the product. Two of the options are AMDs AMD186ES and Lantronixs DSTni-LX, which contains a CPU, serial

ports, Ethernet controller, and RAM. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 161 Software: The Device Servers contain firmware to support Ethernet and Internet protocols, including UDP, TCP, IP, and HTTP. User firmware manages communications between the serial port and the server. For programming, the DSTni-LX Development kit includes a development board and the Paradigm C++ Professional development toolkit. The USNET TCP/IP software suite and a real time operating system are also available separately for use in our own hardware. USNET is compatible with Intel 80x86, Motorola 68K, and other microprocessors. Ubicom IP2022 Wireless Network Processor The CPU used here is optimized for networking with software-configurable peripherals and wireless support.

Ethernet support: 10BASE-T EMBEDDED NETWORKS; UNIT III: Ethernet Basics 162 Hardware: Ubicoms IP2022 Wireless Network Processor (shown in the figure below) is a CPU optimized for networking functions. The chip contains two configurable Serializer/Deserializer blocks. Using software modules provided by Ubicom, each block can support Ethernet, USB, a General Purpose Serial Interface (GPSI), a Serial Peripheral Interface (SPI), or a UART. The CPU uses a 120-Megahertz clock obtained from a 4.8-Megahertz crystal.

Software: Project development uses Ubicoms integrated development environment and GNUPro, a software development suite that includes a C compiler. The suite is built around the open-source GNU standard and is available from Red Hat (www.redhat.com). The IP2022s Core 163 NETWORKS; UNIT for III: Ethernet Basics and Software Development Kit EMBEDDED includes support Ethernet Internet protocols. Ubicoms Universal Device Networking Kit EMBEDDED NETWORKS; UNIT III: Ethernet Basics

164 Netmedia Site Player Ethernet Web Server: This is a very inexpensive module that can serve Web pages and perform UDP communications with a minimum of user programming. Requires a serial link to a CPU to update Web page data and receive data from clients. Ethernet support: 10BASE-T EMBEDDED NETWORKS; UNIT III: Ethernet Basics 165 Hardware: The main purpose of Netmedias SitePlayer is to provide a very low-cost platform for serving Web pages, including pages with dynamic content. For most projects, the SitePlayer communicates with an external CPU over a serial link. The

SitePlayer can place data received from the CPU in its Web pages and can send data from a form or a hyperlink on a Web page to the CPU. The CPU can also use the SitePlayer to send and receive UDP datagrams over a network. In some very basic applications, user can use the SitePlayer without a connection to a CPU, such as applications where users click buttons on a Web page to toggle pins on the SitePlayers board. The SitePlayer contains just two chips: a Philips 8051compatible P89C51 microcontroller and a Realtek RTL8019AS Ethernet controller. 166 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Two 10-pin headers provide access to the Ethernet interface, an asynchronous serial interface, an output for indicating status of the Ethernet interface, a reset input, and eight I/O pins. The microcontrollers Flash memory stores the program code that runs the SitePlayer and the Web pages the SitePlayer

serves. The SitePlayer can store up to 48 kilobytes of Web pages. The SitePlayers development board contains a SitePlayer module and headers for monitoring or connecting to the SitePlayers pins. Also included are an RJ-45 connector for the Ethernet interface, an RS-232 interface and connector for the asynchronous serial interface, a voltage regulator and power-supply connector, an LED controlled by the LINK 167 NETWORKS; UNIT III: Ethernet Basics and output, a Reset button, EMBEDDED and two additional LEDs pushbuttons. Software:

A SitePlayer project requires a SitePlayer Definition file, which is a text file that contains setup parameters and variable definitions in a Siteplayer-specific format. The setup parameters include information such as whether the SitePlayer should receive its IP address from a DHCP server and if not, what IP address to assign to the SitePlayer. The definitions are for variables that will contain dynamic content in the Web pages. The Web pages served by the SitePlayer are like any Web pages except that they may contain pointers to objects that correspond to variables in the Definition file. A ^ before a name indicates a pointer. For example, ^flow is a pointer to the variable flow. When the SitePlayer serves the Web page, it substitutes the current value of the named variable for the pointer. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 168

The firmware inside the SitePlayer manages communications over the Ethernet and serial ports. EDTP Electronics Packet Whacker: This is considered to be an Ethernet interface on a circuit board with headers for connecting to a CPU. Ethernet support: 10BASE-T EMBEDDED NETWORKS; UNIT III: Ethernet Basics 169 Hardware: The Packet Whacker from EDTP Electronics is an Ethernet interface only. The circuit board contains a Realtek RTL8019AS Ethernet controller, an RJ-45 connector, two headers that bring out the signals required to communicate with the Ethernet controller, and related components. User can use the Packet Whacker to add Ethernet to just about any microcontroller. EDTP Electronics has similar boards

with other Ethernet controllers: the NICki has a Cirrus 8900A and the NICkita has an ASIX 88796L. The Whacked 8051 Development Board includes Packet Whacker circuits and adds a Philips P89C668 8051compatible microcontroller and 64 kilobytes of Flash memory. 170 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Software: EDTP provides example Packet Whacker firmware for UDP and TCP communications using a Microchip PIC16F877. The Whacked 8051 Development Board includes C and Basic (BASCOM-51) code for UDP, TCP, and other Internet protocols. Serial-to-Ethernet Bridge This enables RS-232 and RS-485 devices to communicate over networks. Ethernet support: 10BASE-T Hardware: Thousands of existing devices that dont support Ethernet have an RS-232 or RS-485 serial interface. With a

serial-to-Ethernet bridge, user can communicate with these devices in an Ethernet network. The bridge connects to the devices serial interface andEMBEDDED to an Ethernet network. 171 NETWORKS; UNIT III: Ethernet Basics Computers anywhere in the network can then exchange data with the device. After being configured, the bridge transparently sends received serial data on the network in TCP segments and sends data received in TCP segments to the devices serial interface. Two devices that connect to a network via bridges can communicate the same as if they were connected directly by a serial interface. The bridge converts between interfaces as needed. NOTE: Serial-to-Ethernet bridges are available from a variety of sources. Z-Worlds EM1500 Multipoint Serial-to-Ethernet

Bridge supports four RS-232 ports and one RS-485 port. The boards CPU is a Rabbit 3000. R.E. Smiths ESPSX3 Serial Port Server has two RS-232 ports and one port that is 172 EMBEDDED III: Ethernet Basics configurable as an RS-232 port or anNETWORKS; isolatedUNIT RS-485 port. Software: A Serial-to-Ethernet Server typically comes with an application that enables user to enter settings for his/her network and devices include a Web page that he/she can use for configuring when the device is on the network. After configuring, computers on the network can use TCP/IP

applications to communicate with the device. Ethernet Controllers An embedded system that supports Ethernet requires Ethernet controller hardware to provide the Ethernet interface. Many Ethernet controller chips are designed for use in desktop computers and include support for standard PC buses and Plug-and-Play functions. If a module is bought with a controller on it, then that module will probably include firmware support for communicating with the controller. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 173 What the hardware does: Ethernet communications are typically handled by a combination of an Ethernet controller chip and device-driver code that communicates with the controller. The figure below shows the location of the Ethernet hardware

and driver in a network stack. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 174 Many embedded systems use IP with TCP or UDP, but for some applications, the Ethernet driver can communicate directly with the application layer. The controller chip handles many of the details of sending and receiving Ethernet frames. In sending a frame, a controller typically does all of the following: Receives the message to send and the destination address from higher-level software. Calculates the Ethernet frame check sequence. Places data, addresses, and other information in the frames fields. Attempts to transmit the frame when the network is idle.

Detects collisions, cancels any transmitted frame with a collision, and retries according to the protocol specified in the IEEE 802.3 standard (half-duplex interfaces only). EMBEDDED NETWORKS; UNIT III: Ethernet Basics Provides an indication of success or failure of a transmission. 175 In receiving a frame, a controller typically does all of the following: Detects and synchronizes to new received frames. Ignores any frames that are less than the minimum size. Ignores any frames that dont contain the interfaces address or a valid multicast or broadcast address in the Destination Address field. Calculates the frame-check-sequence value, compares the result with the received value, and indicates an error if they dont match. Makes the received frames data and other information available to the receiving computer.

Higher-level software reads the message and does whatever needs to be done with it. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 176 Ethernet Controller Basics In an Ethernet-capable embedded system, a CPU manages communications with the Ethernet controller. The minimum requirement for the CPU is a microcontroller with an external 8-bit data bus. Some of the controllers that have been popular in embedded systems were designed for use on expansion cards for the ISA bus of early PCs. An embedded system that uses an ISA-compatible controller can ignore any unneeded interrupt, address, and status and control pins. Related Components A typical controller requires few additional components.

For 10BASE-T and 100BASE-TX systems, the IEEE 802.3 standard requires an isolation transformer that also functions as a low-pass filter between the controller and the networks RJ45 connector. 177 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Other typical required components include a timing crystal to clock the controller chip and decoupling capacitors for the power pins. Some controllers also support an interface to a serial EEPROM, which can provide nonvolatile, read/write storage of configuration data such as the Ethernet hardware address. Most controllers also have status outputs for interfacing to LEDs. NE2000 Compatibility This is a term which will be used in reference to program code for network controllers NE2000-compatible. The NE2000 was an early and popular PC network interface card from Novell. The card contained National

Semiconductors DP8390 controller. Software for systems that use the 8390 or a compatible chip has come to be known as NE2000-compatible code. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 178 A major feature of the 8390 is its set of internal registers. By reading and writing to the registers, a CPU can configure the controller, initiate transmitting of data on the network, and read received network data. The registers in the 8390 are arranged in two 16-byte pages. The CR register is at offset 00h on both pages. Writing to bits 6 and 7 in the CR register selects the current page. Offsets 01h through 0Fh on each page store additional register values. On power-up or reset, program code typically initializes the registers to desired values before Ethernet data transfers begin. An NE2000-compatible chip should support all of the 8390s registers. Newer chips generally have additional register pages to

support new features. NE2000-compatible chips are also likely to support accessing buffer memory at addresses 4000h through 7FFFh. A portion of the memory forms a ring buffer for storing data received from the network, and the remainder of the memory stores data to be 179 transmitted on the network. EMBEDDED NETWORKS; UNIT III: Ethernet Basics The ASIX AX88796 An Ethernet controller designed for use in embedded systems is the AX88796 3-in-1 Local Bus Fast Ethernet Controller from ASIX Electronics Corporation. Rabbit Semiconductor uses this controller in its RCM3200 module. The controller supports Ethernet communications at 10 & 100 Mb/s. The 88796 is NE2000-compatible. A major difference between the 88796 and the DP8390 is that the 88796 has an on-chip 16kilobyte static RAM (SRAM) buffer for network data. The 88796 also has separate (not multiplexed) data and address buses and an interface to serial EEPROM.

The figure below shows the basic connections the RCM3200 module uses for the 88796. The chip is a 128-pin plastic light quad flat pack (PLQFP). The clock is a 25-Mhz crystal or oscillator. The power supply is +3.3V. Three outputs drive status LEDs. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 180 ASIX AX88796 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 181 Ethernet: For twisted-pair networks, the chip can connect through a filter to an RJ-45 jack. The RCM3200 uses a Pulse Jack module from Pulse Engineering, Inc. The module integrates the RJ-45 connector and filtering circuits in a single package. An on-chip MII (Media Independent Interface)

enables using an external PHY to connect to other cable types at 10 or 100 Mb/s. Bus Compatibility: The CPU0 and CPU1 pins configure the chip for use with one of four bus types that are popular in embedded systems: ISA, Intel 80186, Intel MCS-51 (8051), and Motorola 68000. The selected bus determines the functions of the pins that control reading and writing to the external data bus and the polarity of the interrupt output. For example, on a 68000 bus, pin 18 is a R/W input that controls bus reads and writes and pin 19 has no connection, while the ISA interface has separate read and write signals: pin 18 is IOWR and pin 19 isNETWORKS; IORD. UNIT III: Ethernet Basics 182 EMBEDDED SRAM: The controllers 16-kilobyte SRAM buffer holds packets waiting to transmit on the network and packets received from the network. With an 8-bit data bus, only 8 kilobytes of the SRAM are

available. Addressing: The chip has 10 address inputs, but not all systems need them all. The first five bits (SA0 through SA4) address the controllers internal registers. Every controller must have these lines connected to the CPUs address bus. Two of the registers (10h, 11h) are the Data Port, which enables the CPU to access the controllers 16 kilobytes of SRAM without using additional address lines. In most systems, the Ethernet controller shares the data bus with other components, so the CPU needs a way to select the controller on the bus. Two ways to accomplish this are by using additional address lines to select a base address or by using the controllers Chip Select (/CS) input. 183 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The 10-BASE0, 10-BASE1, and 10-BASE2 pins on the 88796 can select one of eight base addresses. Jumpers or

CPU outputs can control the pins, or they can be hard-wired. For example, if the controller has a base address of 200h, the CPU accesses the chips registers by reading and writing to the addresses 200h through 21Fh. To enable selecting the chip by address, the controllers address pins SA5 through SA9 must connect to the CPUs address bus. If suppose the chip select input is used to select the chip, then the user does not require to connect the controllers upper address range than the options programmed into the chip. Rabbit Semiconductors RCM3200 module uses the Chip Select along with firmware that configures the Rabbit 3000 CPU to strobe a port bit on I/O accesses to a specific address range. 184 EMBEDDED NETWORKS; UNIT III: Ethernet Basics When using Chip Select, SA5 through SA9 must match the selected base address in the controller. The RCM3200 module permanently enables base address 200h by tying SA9 high

and tying SA5 through SA8 low at the controller. Data: A register bit in the 88796 selects whether the controller uses 8 or 16 data lines. The data bus for the 68000 mode must be 16 bits, but the other buses can use 8 or 16 bits. Interrupts: The IRQ interrupt output can request service from the CPU. The polarity of the signal depends on the selected bus type. A CPU that does not support or does not want to use interrupts can poll the interrupt line. Serial EEPROM Interface: The 88796 has four pins that can interface to a serial EEPROM with a Microwire interface. The EEPROM can provide non-volatile storage for an Ethernet hardware address 185 EMBEDDED NETWORKS; UNIT III: Ethernet Basics and other information. Unlike some other controllers, the 88796 doesnt automatically load information from the serial EEPROM into the controllers registers. Instead, the CPU must access the

EEPROMs contents by reading and writing to the MII/EEPROM Management Register. The CPU can then copy the information it reads from the EEPROM to other registers. If the system already has flash memory or other non-volatile, read/write memory, component cost can be saved by using existing memory to store the configuration data instead of a serial EEPROM. This is the approach Rabbit Semiconductor uses in its RCM3200 module. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 186 Transferring Data: Like the DP8390, the 88796 uses direct memory access (DMA) to automate transfers of network data into and out of the SRAM. The CPU reads and writes to the Data Port register, and the controller stores or retrieves the data at sequential addresses in the SRAM.

Receiving Data: The 88796 stores data received from the network in a portion of the chips SRAM reserved as a ring buffer. In a ring buffer, two pointers determine where to read and write next. The write pointer increments after each write to the buffer. After writing to the highest address, the pointer wraps back to the lowest address, forming a ring. Meanwhile, as the CPU reads the data from the buffer, the read pointer steps through the buffer in a similar way. To prevent lost data, the CPUEMBEDDED must retrieve

the data fast enough to 187 NETWORKS; UNIT III: Ethernet Basics keep the buffer from overflowing. In the 88796, the Page Start Address Register (PSTART) and Page Stop Address Register (PSTOP) determine the buffers size. Typically, half or more of the SRAM is reserved for the ring buffer, with the remainder left for the transmit buffer. The ring buffer is structured as a series of 256-byte buffers, or pages. The Boundary Pointer register (BNRY) is the read pointer, which holds the page address of the next data packet for the CPU to read.

The Current Page Register (CPR) is the write pointer, which holds the page address for storing the next data packet received from the network. In storing a frame in the ring buffer, the controller reserves the first four bytes for storing the contents of the Receive Status Register (RSR), the address of the next packet to be stored in the buffer, and the number of bytes received. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 188 The SRAM stores a received frame only if the destination address matches the controllers hardware address or another address the controller is configured to accept. The Physical Address Registers (PAR0PAR5) contain the interfaces Ethernet hardware address. Also the controller accepts frames sent to a multicast address specified in the controllers Multicast Address Registers (MAR0 MAR7), and the controller accepts broadcast transmissions if the

Accept Broadcast (AS) bit is set in the Receive Configuration Register (RCR). The Receive Configuration Register also permits configuring the chip in promiscuous (easy) mode, which causes the controller to accept frames with any destination address. On receiving a frame, the controller checks for CRC and framealignment errors and checks to be sure the frame is at least the minimum allowed frame size. The controller drops any frame that shows an error or isnt the minimum size. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 189 When the contents of a frame are available in the ring buffer, the controller asserts an interrupt. The CPU can then use the controllers Remote Read command to retrieve the data from the ring buffer. The CPU reads all of the data from a single DMA-port address (10h) and the controller provides the bytes in sequence. Sending Data:

Sending data on the network requires two steps: The CPU first copies the data to send to the SRAM and then instructs the controller to send the frame on the network. The CPU uses the controllers Remote Write command to write the data to transmit to the controllers SRAM. The CPU writes all of the data to the DMA-port address (10h), and the controller stores the bytes in sequence. Transmitting doesnt use a ring buffer because the CPU can control the transfer of data into the buffer. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 190 After copying data to send to the SRAM, the CPU writes the starting page address of the data to the Transmit Page Start Register (TPSR) and writes the number of bytes to transmit to the Transmit Byte Count Registers (TBCR0, TCBCR1). When the CPU sets the TXP bit in the Command Register, the controller sends the specified bytes in a frame on the network.

The controller adds the preamble, start-of-frame delimiter, and CRC values in the appropriate locations in the Ethernet frame to be transmitted. The controller also decides when to attempt to send the frame on the network, sends the bits to the network interface in sequence, and handles collisions and retries. When a transmission is complete, an interrupt informs the CPU so it can prepare another frame to send or take other 191 EMBEDDED NETWORKS; UNIT III: Ethernet Basics action. Realtek RTL8019AS: For embedded systems with 10BASE-T support, one of the most popular controllers has been the RTL8019AS Full Duplex Ethernet Controller with Plug and Play Function from Realtek Semiconductor Corp. The 8019AS is another NE2000-compatible derivative of the

DP8390. Like the ASIX 88796, the 8019AS has an on-chip 16-kilobyte SRAM and an interface to serial EEPROM. The 8019AS is designed for use with the ISA bus, but the chip can also interface to other 8- and 16-bit buses. Connections The figure below shows a portion of the schematic for Rabbit Semiconductors RCM2100 module. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 192 Realtek RTL8019AS Full Duplex Ethernet Controller EMBEDDED NETWORKS; UNIT III: Ethernet Basics 193 The chip is a 100-pin quad flat pack (QFP). The clock is a 20Mhz crystal or oscillator. Four outputs can drive status LEDs. The power supply is +5V.

Ethernet: For 10BASE-T networks, the chip can connect through a filter to an RJ-45 jack. The chip also contains an AUI to enable using other 10-Mb/s media systems. SRAM: The controllers 16-kilobyte SRAM buffer holds packets waiting to transmit on the network and packets received from the network. When using 8-bit data, only eight kilobytes of the buffer are available. Addressing: The address bus is 18 bits. The first five bits address the controllers internal registers. If the controller shares the bus with other chips, it can use additional address lines to select the chip on the bus. The chip allows a choice of 16 PC-compatible base addresses. The IORB and IOWB inputs control the read and write operations. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 194 Data: A register bit selects whether the controller uses 8 or 16 data lines.

Interrupts: An interrupt output can request service from the CPU. Three bits in the controllers CONFIG1 register select one of eight interrupt outputs on the controller. On an ISA card, seven of these outputs each connect to one of the IRQ lines on the ISA bus. This enables a PC to configure the card to use an available IRQ line by writing the appropriate value to the register. The eighth output, INT0, has no assigned ISA-bus IRQ line. A small embedded system may wire IRQ0 directly to an interrupt on the CPU. A CPU can also poll IRQ0 to find out when an interrupt has 195 EMBEDDED NETWORKS; UNIT III: Ethernet Basics occurred. Serial EEPROM Interface: On power-up, the 8019AS can be configured to retrieve information from a serial EEPROM or another component with a compatible interface. Pins BD5, BD6, and BD7 can function as the clock, data

input, and data output for a Microwire synchronous serial interface. These lines can connect to a 9346 serial EEPROM, which can store 1024 bits organized as 64 words of 16 bits each. The 8019AS has assigned EEPROM locations for initial values of configuration registers, an Ethernet address, and Plug and Play information. If a system already has Flash memory or other non-volatile, read/write memory, component cost can be reduced by using 196 EMBEDDED NETWORKS; UNIT III: Ethernet Basics the existing memory to hold the configuration data instead of

a serial EEPROM. Transferring Data: The 8019AS manages network data much like the 88796, using DMA to transfer data into and out of the SRAM and storing received data in a ring buffer. Realtek also offers controllers that support Fast Ethernet and Gigabit Ethernet. SMSC LAN91C96: Another Ethernet controller designed specifically for embedded systems is Standard Microsystems Corporation (SMSC)s LAN91C96 Non-PCI Full Duplex Ethernet Controller with Magic Packet. Dallas Semiconductors DS-TINI-1 module uses this controller. The 91C96 supports 10BASE-T Ethernet and has an AUI to support other 10-Mb/s media systems. The chip is a 100-pin QFP or thin quad flat pack (TQFP). The power supply can be +5V or +3.3V. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

197 Because its not intended for use in PCs, the 91C96 doesnt have an ISA or PCI interface or support for Plug and Play. Instead it has a generic local-bus interface and also supports PC Card (PCMCIA) and Motorola 68000 buses. The configuration registers are not NE2000-compatible. The chip can use 8 or 16 data lines and up to 20 address lines. An external serial EEPROM can store configuration information. A 6-kilobyte SRAM stores received network data and data waiting to transmit. The controller dynamically allocates the amount of memory used for transmitting and receiving according to the traffic. To ensure that some transmit memory is available, the chip can be configured to reserve a portion of memory for 198 EMBEDDED NETWORKS; UNIT III: Ethernet Basics transmitting.

The chip supports Magic Packet, which is a power-conserving technology that enables the controller to wake from a sleep mode on receiving a special Magic Packet from the network. The Magic Packet contains a synchronization stream consisting of six bytes of FFh, followed by 16 repetitions of the controllers hardware address. AMD licenses the Magic Packet technology to chip manufacturers such as SMSC. Cirrus Logic CS8900A An older ISA-based controller thats suitable for some embedded systems is Cirrus Logics CS8900A Crystal LAN ISA Ethernet controller. The 8900Ais not NE2000-compatible. Instead it defines its own set of registers in on-chip SRAM that it calls Packet Page memory. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 199

For 10-BASE-T networks, the chip can connect through a filter to an RJ-45 jack. An AUI port enables connecting to other 10-Mb/s media systems. There are versions for +5V and +3.3V power supplies. The package is a 100-pin TQFP. A serial-EEPROM interface enables the storing of addressing and other configuration data. The Packet Page memory is 4 kilobytes. The first 350 bytes hold the contents of registers for configuring the bus interface, providing status and control information, initiating transmits, and address filtering. The rest of the memory holds received Ethernet frames and frames waiting to transmit. The amount of memory allocated for each direction can vary depending on the traffic. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 200 The chip has 20 address lines. Although the controller

supports both 8- and 16-bit data, there are several limitations with 8-bit data. When configured for 8-bit data, the controller doesnt support interrupts. The CPU must poll the chip to find out when a received frame is available, when a frame has finished transmitting, or when an error has occurred. With 8-bit data, there is no EEPROM interface, no support for DMA, and no auto-incrementing of the Packet Page pointer. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 201 Using the Protocol in Local and Internet Communications The protocols in the IEEE 802.3 Ethernet standard enable the computers in a local network to exchange messages with each other. In practice, most Ethernet networks also use Internet

protocols such as TCP or UDP and IP. These provide defined and well-supported methods for accomplishing common tasks such as flow control and flexible addressing and routing of messages. Messages that travel on the Internet must use IP. And because TCP and UDP are designed to work along with IP, local communications that use TCP or UDP also use IP. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 202 Connecting to the Internet: To communicate over the Internet, a computer must have three things: an IP address that identifies the computer on the Internet, the ability to send and receive IP datagram's, and a connection to a router that can access the Internet. An Internet Service Provider (ISP) can provide one or more IP addresses and a connection to a router that can communicate over the Internet. Customers use a variety of ways to connect to

ISPs. Connections that support low to moderate traffic typically connect to the ISP via a modem or other device that interfaces to a phone line or a cable from a cable-TV provider. Considerations in Obtaining Internet Service In many Internet communications, one computer functions as a client, and the other as a server. A client requests resources from a server. A resource may be a Web page, file, or other data.EMBEDDED NETWORKS; UNIT III: Ethernet Basics 203 In response to a request, a server sends the client the requested resource or a response such as an error message. Microsofts Internet Explorer and other Web browsers are clients. The text that user type or copy into the browsers Address text box (such as http://www.Lvr.com or http://192.168.111.1) identifies the resource user is requesting and the server user is requesting it from. The computers that host the resources are functioning as servers, which detect, interpret, and respond to requests from

computers on the Internet or in a local network. Many servers are huge systems that store thousands of files, but a server can also be a small embedded system that serves a few basic Web pages or other information on request. 204 EMBEDDED NETWORKS; UNIT III: Ethernet Basics If users on the Internet want to request Web pages, download or upload information, or access other resources on his/her system, then three things are required: computer that functions as a server, an Internet account that permits hosting a server, and network-security settings that enable the server to receive and respond to requests from other computers in the network without putting other local resources at risk. When selecting a method of connecting, user has to consider the speed in both the upstream (towards the Internet) and downstream (from the Internet) directions. For many inexpensive accounts, the upstream speed is slower than the downstream speed. This arrangement is generally

fine for home users, who tend to use Internet connections for activities such as Web surfing, where most of the traffic is downloads. 205 EMBEDDED NETWORKS; UNIT III: Ethernet Basics In contrast, a server sends most of its data upstream. Still, an embedded system that serves very basic Web pages or transfers moderate amounts of data may function fine with a slower connection. To host a server, its likely that user need a business, or commercial, account with his/her ISP. In addition to limited speed for upstream communications, accounts offered to home users typically forbid hosting servers because a server is likely to draw more traffic than the ISP can support at home user prices. For home accounts, some ISPs block unsolicited requests to port 80, which is the default port where Web servers receive requests.

One option that uses a different approach is worth a mention 206 NETWORKS; UNIT III: Ethernet Basics for applications where anEMBEDDED embedded system only needs to provide information periodically to a server on the Internet. Many ISPs and other companies offer Web hosting services that enable user to host Web pages on one of the companys servers. User can upload the files, typically via FTP, to the server, and the server responds to requests to view the pages. For some applications, user can program a device to send files to the server as needed and let the server handle the work of serving requests on the Internet. With this arrangement, the device doesnt have to function as a server; it just needs to be able to transfer files as needed to a remote server. Technologies for Connecting:

There are several options for obtaining an Internet connection. A long-popular way for home users to connect to the Internet is via dial-up connections on phone lines. For higher speeds, alternatives are a Digital Subscriber Line (DSL), an Integrated Services Digital Network (ISDN) line, or a cable modem. Satellite connectionsEMBEDDED are alsoNETWORKS; possible.UNIT III: Ethernet Basics 207 The table below compare the capabilities of the different methods. Access Type Downstream Speed Upstream Speed Transmission (kb/s, typical max) (kb/s, typical max) Medium Dial up 56 56

phone line ADSL 1500 384 phone line SDSL 2000 2000 phone line

BRI ISDN 128 128 phone line PRI ISDN 1500 (23 channels) 1500 (23 channels) phone lines Cable modem 1500, shared 384, shared TV cable Satellite

50 wireless 500 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 208 Depending on the type of access and the equipment that connects to the provider, Internet communications may use Ethernet, serial port (RS-232), or USB. Ethernet is fast and flexible, and an Ethernet network enables multiple computers to share a connection. Hardware support for RS-232 is very inexpensive. Most microcontrollers have an on-chip UART and require only a TTL-to-RS-232 converter.

A computer that connects to the Internet via an RS-232 connection to a modem doesnt have to support Ethernet at all. Instead, the computer can use the Point-to-Point Protocol (PPP) to send and receive IP datagrams over the RS-232 connection. USB modems must connect to a PC or other USB host, while most USB-capable embedded systems are UNIT USB Also, 209 EMBEDDED NETWORKS; III: devices. Ethernet Basics USB modems typically come with driver software for Dial Up

A dial-up connection is available anywhere there is phone service. A modem provides an interface between a computer that wants to access the Internet and an ordinary phone line (shown in the figure below). To make a connection, the computer instructs the modem to dial a number that connects to a modem at the ISP. The ISPs modem in turn connects to a router with an Internet connection. Customer Site EMBEDDED NETWORKS; UNIT III: Ethernet Basics 210 PCs modem may be on the motherboard or an expansion card, or the modem may connect to the PC via an RS-232 or USB port. An embedded system may also contain a modem or connect to an external modem, usually via RS-232. The computer uses the Point-to-Point Protocol (PPP) to manage the

modem connection and to send and receive IP datagrams over the serial link. Rabbit Semiconductors Dynamic C has an optional module with libraries and example code for PPP communications. Limitations of dial-up connections are a maximum speed of 56 kilobits per second and the need to provide a phone line for the connection. Advantages are low cost and availability anywhere there is phone service. In general, a dial-up connection isnt the best option for a server because of limited speed. But dial up can be useful for some computers that occasionally communicate on the Internet. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 211 For example, a series of data loggers might periodically dial in to send readings to a central computer that is on the Internet and programmed to accept the communications from the data loggers. A system with a dial-up connection may also communicate by sending and receiving e-mail.

Multiple systems can share a dial-up account if each calls in turn. A computer that connects to an ISP via dial-up may also use Ethernet to connect to a local network. DSL: DSL uses a conventional phone line with equipment at each end to enable the line to carry voice and Internet communications at the same time. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 212 The figure shown below shows a typical configuration where the Customer Site In the upstream direction, a splitter combines phone and Internet traffic on a single pair of wires. In the downstream direction, the splitter routes the phone and

Internet traffic onto the appropriate wires inside the customers premises. Another name for the splitter is network interface device (NID). EMBEDDED NETWORKS; UNIT III: Ethernet Basics 213 The line carrying Internet traffic in the customers premises connects to a DSL modem, which has a USB or Ethernet connection to the customers computer. At the phone companys central office, phone traffic is routed to and from the companys switching equipment, and Internet traffic is routed to and from a DSL Access Module (DSLAM). The DSLAM interfaces to the companys DSL equipment, which connects to the Internet. DSL connections often use Point-to-Point Protocol over Ethernet (PPPoE). PPPoE requires logging on with a user name and password but doesnt require dialing a phone

number to connect to the ISP. Dynamic Cs PPP module supports PPPoE and includes an 214 EMBEDDED NETWORKS; UNIT III: Ethernet Basics example application. Two popular options are asymmetric DSL (ADSL) and singleline, or symmetric DSL (SDSL). With ADSL, traffic in each direction has a different speed, with the downstream speed typically much faster than the upstream speed. Embedded systems that host busy Web or FTP servers will probably find SDSL, with equal speeds in both directions, more suitable. The speed of a connection varies with the DSL variant, the distance from the phone companys central office, and the quality of the phone line. Theoretically, ADSL can support speeds as high as 6.1 Mb/s downstream and 1.5 Mb/s upstream. In practice, speeds are likely to be equal to or less than 1.5 Mb/s downstream and 384 EMBEDDED

kb/s upstream. 215 NETWORKS; UNIT III: Ethernet Basics The theoretical maximum for SDSL is 2 Mb/s in each direction. The maximum distance between the customer and the central office is around 18,000 feet for ADSL and 18,000 to 22,000 feet for SDSL. ISDN: Like DSL, ISDN connections can use conventional phone lines. ISDN has two main variants. With Basic Rate Interface (BRI) ISDN, the phone line carries two 64-kb/s B channels that can be combined for a single 128-kb/s connection. A separate lower-speed D channel carries signaling information. The figure below shows the computer that wants to communicate over the Internet connects via Ethernet, RS-232, or USB to an ISDN terminal adapter, which in turn connects to a network termination.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 216 With BRI ISDN, one channel can carry voice or fax signals while the other carries data, or for a higher-speed connection, both channels can carry data EMBEDDED NETWORKS; UNIT III: Ethernet Basics 217 The customers phone line connects the network termination to a switch at the phone companys central office, which routes the traffic to and from the ISP. Its also possible to use one ISDN channel for voice traffic and the other for a 64-kilobit Internet connection. If BRI ISDN is not enough, Primary Rate Interface (PRI) ISDN has 23 channels and speeds of up to 1.544 Mb/s. A BRI connection requires a T1 line, which is a special 4-wire

phone line that carries digital data from the central office to the customer. Cable Modem: A cable modem doesnt use phone lines, but instead uses a connection to a cable-TV provider that offers Internet access. The same cable can carry TV broadcasts and Internet traffic. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 218 Figure below shows the computer that wants to communicate over the Internet connects via Ethernet or USB to a cable modem. Customer Site EMBEDDED NETWORKS; UNIT III: Ethernet Basics 219

The cable modem in turn connects to a filter and splitter, then connects via coaxial cable to a neighborhood concentrator, which has a high-speed connection to the cable companys facility. The cables bandwidth is divided into channels. Each TV channel uses a 6-Mhz portion of the bandwidth. Internet traffic typically uses bandwidth above the TV channels for downstream traffic and bandwidth below the TV channels for upstream traffic. With a cable modem, the user can share bandwidth with other customers in the neighborhood. So the performance of a cable-modem connection depends in part on the network speed provided by the account and in part on how much other traffic there is at the same time. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 220 Typical network speeds for cable modems are from 256 kb/s

to 1.5 Mb/s downstream and up to 384 kb/s upstream. Most providers encrypt the Internet traffic so customers who share a connection cant view each others data. Because cable-TV providers market to residential customers, cable Internet may be unavailable at a business location. Because of the expense of running cable, cable Internet may be unavailable in remote locations. Satellite Another option for obtaining Internet access, especially for remote areas, is a satellite link shown in the figure below. Early offerings of Internet access via satellite were downstream only, requiring a phone-line connection for upstream data. 221 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Newer systems offer 2-way communications via satellite. Satellite

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 222 Download speeds range between 150 to 500 kb/s, with upstream speeds of around 50 kb/s. he low-speed upstream communications make satellite links less than ideal for hosting a server. The satellite dish requires a view of the southern sky. The satellite modem may connect via Ethernet or USB to a customers computer. Static and Dynamic IP Addresses Every computer that communicates over the Internet must have an IP address, which the computer typically receives from its ISP. The IP address may be static or dynamic. A static IP address stays the same until someone explicitly changes it, while a dynamic IP address can change on every boot up or network connect (though the address typically changes only

223 EMBEDDED NETWORKS; UNIT III: Ethernet Basics occasionally). An embedded system may store a static IP address in nonvolatile memory, either within an application or in memory where program code can retrieve the address when needed. For hosting a domain, a static IP address is preferable because the name servers dont have to be updated unless the domain changes ISPs. If the computer hosting the domain has a dynamic IP address, the local name servers must be updated when the address changes. Connecting Multiple Computers to the Internet A computer that connects to the Internet must have an IP address that is different from the addresses of all of the other computers on the Internet. When contracted with an ISP, user obtain the right for your computer to use one or more of the ISPs assigned IP 224

EMBEDDED NETWORKS; UNIT III: Ethernet Basics addresses. If a local network is present with multiple computers that need Internet access, its often easier, more secure, and less expensive to have all of the computers share a single public IP address for Internet communications. Some ISPs charge for each connected computer whether or not they share an IP address. Two ways to enable multiple computers to share a public IP address are with a router that supports the Network Address Translation (NAT) protocol and with a Windows PC configured as an Internet Connection Sharing host. A router that supports the NAT protocol enables multiple computers to share a public IP address. The router connects to the ISP and to the computers in the local network. The router has two IP addresses: a public address for Internet communications and a local address for communicating with 225

EMBEDDED NETWORKS; UNIT III: Ethernet Basics the local network. The router uses the NAT protocol to translate between the public and local addresses as needed. To send a message on the Internet using a router with NAT support, a computer in the local network sends the message to the routers local address. The router creates a new IP datagram, placing the message in the datagrams data area and the routers public IP address in the datagrams Source Address field. The router then forwards the datagram to a router at the ISP, which sends the datagram onto the Internet. On receiving a datagram from the ISPs router, the local router uses information in the IP header to determine where to forward the message. The router then creates a new datagram with the appropriate local IP address in the datagrams Destination Address field 226

NETWORKS; UNIT III: Ethernet Basics and forwards the datagram EMBEDDED to its destination. If a local network includes a PC running Windows XP, there is another option. Multiple computers can be enabled to share a public IP address by configuring the PC as an Internet Connection Sharing host. The PC requires two network interfaces, one to the local network and one to the modem or other connection to the ISP. In Windows XPs Network Setup Wizard, select This computer connects directly to the Internet. The other computers on the network connect to the Internet through this computer. All Internet communications for the local network then go through the interfaces on this computer. NOTE: Windows Help has more information on using Internet Connection Sharing.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 227 Communicating through a Firewall Any PC or other large computer with Internet access should have a firewall. All communications from outside the local network should pass through the firewall to reach a computer in the local network. The firewall protects the local network by controlling what local resources external computers can access. A firewall may be software only or a combination of hardware and software. Without a firewall, a computer from outside the network might be able to retrieve private files, install a program that deletes files, or use another computer to launch attacks on other computers. A firewall can also defend against denial-of-service attacks, where a computer attempts to overwhelm a server by bombarding it with requests using forged, invalid source

addresses. 228 EMBEDDED NETWORKS; UNIT III: Ethernet Basics In a local network, each computer may have its own firewall, or a single firewall may protect all of the computers in the network. The firewall may be software running on a PC or another general-purpose computer, or it may be a device designed specifically to function as a firewall. For networks that use a single firewall, the firewall is the only computer in the local network with a direct Internet connection. The figure below shows, all of the other computers send and receive Internet communications by communicating with the computer that contains the firewall. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 229

Communicating through a Firewall EMBEDDED NETWORKS; UNIT III: Ethernet Basics 230 Some operating systems have firewall software built in. For example, Windows XP has an Internet Connection Firewall that you can configure for specific needs. A hardware firewall for a small local network may provide additional capabilities, including functioning as a router with address translation and functioning as a DHCP server. Even when an embedded system doesnt need a firewall to protect itself, many embedded systems are behind a firewall because theyre in local networks that have firewall protection. If an embedded system is behind a firewall, you may need to configure the firewall to enable a system to communicate.

In a common setup, a firewall allows the local computers to 231 EMBEDDED NETWORKS; UNIT III: Ethernet Basics request resources from computers on the Internet. For example, the firewall typically enables local computers to request Web pages from computers on the Internet. The firewall stores information about each request, and when the computer returns an IP datagram containing the requested page, the firewall examines the header, determines that the datagram is in response to a previous request, and passes the datagram to the requesting computer. If the firewall does not recognize a datagram as a response to a previous request, the datagram doesnt pass through the firewall. A computer that functions as a server available to all computers on the Internet must be able to receive unsolicited requests because the computer has no way of knowing where requests will come from. So user has to configure the firewall to allow the server to

receive unsolicited communications on at least one port. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 232 Typically, to enable a specific computer to serve Web pages, configuration can be done to the firewall to forward all open, or unsolicited, communications for port 80, which is the port used for HTTP requests, to the computer that serves the pages. The figure below shows an example configuration setup. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 233 Obtaining and Using a Domain Name After obtaining Internet access, an embedded system has to be connected to the Internet, and configure the firewall to enable

the embedded system to communicate. Applications running on other computers on the Internet can access the embedded system by specifying its public IP address. For example, to view a servers home page, in the Address text box of a Web browser, enter http:// followed by the servers IP address. Each IP address is 32 bits, typically expressed as four bytes in a format known as dotted quad, or dotted decimal, consisting of four decimal numbers separated by periods, or dots, as in 216.92.61.61. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 234 An alternate, more human-friendly way to identify a computer on the Internet is with a domain name. Instead of remembering four numbers, users can provide a name such as rabbitsemiconductor.com or dalsemi.com.

Another advantage of a domain name is that it can remain constant. The IP address of a particular Web page or other resource may change, either because the owner of the domain has changed ISPs or because the ISP uses dynamic IP addresses that change from time to time. A system that functions as a client has no need for an easily remembered name because the client initiates all communications, and each request received from a client includes the IP address to respond to. 235 EMBEDDED NETWORKS; UNIT III: Ethernet Basics A computer that only responds to communications from selected computers that know the computers IP address does not need a domain name either. But a domain name can be useful and convenient for an embedded system that functions as a server thats available to

any computer on the Internet. To obtain the right to use a domain name, name has to be registered and provide two name servers that will respond to requests for the domains IP address. Understanding Domain Names A domain name consists of a name that is unique within its root domain, followed by a dot and the name of the root domain. Some examples are: rabbitsemiconductor.com dalsemi.com rfc-editor.org EMBEDDED NETWORKS; UNIT III: Ethernet Basics 236 The original defined root

domains were .com, .edu, .gov, .mil, .net, and .org. A domain name may also contain a country-code top-level domain after the root: number-10.gov.uk One or more names to the left of the main domain may identify subset(s) of a domain: minordivision.majordivision.example.com The order of the names of the subsets indicates their hierarchy. In the example above, majordivision is a subset of example.com, and minordivision is a subset of majordivision. The letters www preceding a domain name specify that the request should be routed to the domains Web server: www.Lvr.com Many domains are configured so that including www is optional. On receiving an HTTP request that doesnt include 237 EMBEDDED NETWORKS; UNIT III: Ethernet Basics the www, the domains software passes the request to the Web

server by default. How a URL Specifies a Resource When requesting a file or other resource from a computer on the Internet, a computer provides a uniform resource locator (URL) that helps in identifying the location of the resource and tells the server how to respond to the request. A URL specifies the protocol to use in reading the request, the name or IP address of the server that hosts the requested resource, the path to the file on the server, and the name of the requested resource (or no name to request a default file). The document that defines URLs is RFC 1738: Uniform Resource Locators (URL). At minimum, a URL specifies a scheme that identifies a protocol such as HTTP, followed by scheme-specific information such as a host name that identifies the location of a requested file. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

238 A host name is either an IP address in dotted-quad format or a domain name. Here is an example of a URL that requests a page from a Web server: http://www.example.com:80/data/testdata.htm http:// contains the scheme that tells the server to use the hypertext transfer protocol (HTTP) in responding to the request. Other schemes include ftp for FTP transfers and mailto for links to e-mail messages. Many browsers add http:// if you omit the scheme when specifying a URL in the browsers Address text box. example.com specifies the domain, and www specifies the Web server at the domain. :80 specifies the port the client sends the request to. If the URL doesnt include a port number, the client uses the protocols default port. 239 NETWORKS;

III: Ethernetprotocols. Basics RFC 1738 specifies default EMBEDDED port numbers forUNITstandard The default for HTTP is port 80. /data/ names a folder within the servers root folder. A small embedded system may store all of its files in the servers root folder. Forward slashes separate folder and file names even if the servers file system uses different separators. The name of the requested file is testdata.htm. When a URL doesnt specify a filename, most Web servers are configured to serve a default home page, often titled index.html. If you leave off the http://, most browsers insert it for you. Every domain should have a default page to serve if no page is specified.

And many servers are configured to serve a Web page even if the URL doesnt contain www. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 240 Registering a Domain Name If user want to be able to access an embedded system by specifying a domain name, he/she must register the name with an appropriate authority. Registering in turn requires providing two name servers that respond to requests for the domains IP address. In addition, each country-code top-level domain has a sponsoring organization for registering domains. The Internet Assigned Numbers Authority (IANA) at ww.iana.org has information about registering these domains. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

241 Matching a Domain Name to Its IP Address Name servers enable computers to match a domain name with the IP address required to access the domains resources. Domain names are convenient for humans who are requesting resources, but each request ultimately must translate into one or more IP datagrams that contain the IP address of the datagrams destination. A system that communicates only with a defined set of hosts could store a lookup table that matches each host name with its IP address. If a host changes its IP address, the lookup table will need updating. More commonly, matching a domain name to its IP address involves communications between one or more domain-name servers and a resolver. A domain-name server is a computer that stores records that match domain names with their

IP addresses. 242 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The resolver is a program or process that uses the domainname-system (DNS) protocol to communicate with name servers to find a match between a domain name and its IP address. Each registered domain name must have two name servers that respond to queries for the domains IP address. The ISP that provides the domains IP address typically provides the name servers. Once the name servers are set up and operating, the computers on the Internet need to learn about their existence. The Internet has a series of root name servers that store root zone files containing the IP addresses of the name servers for all registered domains. 243 EMBEDDED NETWORKS; UNIT III: Ethernet Basics

Each server stores records for one of the root domains such as .com, .edu, or .mil. To ensure that the information is always available even if a server fails, each root domain has multiple servers. The root name servers operate under the direction of IANA and are updated regularly. The servers are in varied locations and are owned by different entities. To learn a domains IP address, a computer uses the DNS protocol to send a query to a resolver, which may reside in the same computer that originated the query or elsewhere. The resolver first searches its own cache and returns the answer if found. If not, the resolver attempts to find the answer by querying a name server. 244 EMBEDDED NETWORKS; UNIT III: Ethernet Basics A local network may have an assigned local name server that

functions as the resolver for queries from the local network. The local name server knows the addresses of the root name servers and maintains a database of information obtained from previous queries. If the local name server does not have the answer in its database, it queries a root name server or another server that it thinks may have the information. On receiving a query, a name server may return the requested IP address or the IP address of another server that is likely to have the information. For example, to learn the IP address for www.example.com, a resolver may send a query to a .com root domain server that returns the address of the name server for example.com. The resolver can then query this name server for the address 245 EMBEDDED NETWORKS; UNIT III: Ethernet Basics of www.example.com. To learn the IP addresses of a local networks name servers, in

Windows XP, click Start > Run, type cmd, and click OK. In the window that appears, type ipconfig /all. In the information displayed are the IP addresses of two DNS servers. Although an embedded system with a domain name must have name servers that other computers can access to learn the domains IP address, many embedded systems dont need to communicate with name servers themselves. An embedded system functioning as a server just needs to respond to requests that contain a source IP address to respond to. Other systems may communicate only with computers with known IP addresses. Systems that communicate only in a local network dont need to support domain names at all, though local computers may have locally assigned host names that correspond to local IP 246 EMBEDDED NETWORKS; UNIT III: Ethernet Basics addresses. Inside the Internet Protocol

The Internet Protocol (IP) helps data find its way to its destination even if the data must travel through other networks, including the many and varied networks that make up the Internet. Although its called the Internet Protocol, local networks can use IP as well. Many communications in local networks use IP because they use its companion protocols, TCP and UDP. What IP Does Figure below shows the place of the IP layer in network communications in the networking stack EMBEDDED NETWORKS; UNIT III: Ethernet Basics 247 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 248

In transmitting, the IP layer receives a message to send from a higher-level protocol layer such as TCP or UDP. The IP layer places the message in an IP datagram that consists of an IP header, followed by the message to send. The IP layer then passes the datagram to a lower layer such as an Ethernet driver, which sends the datagram on the network. On the way to its destination, a datagram may pass through one or more routers. The router examines the destinations IP address and uses the address in deciding where to forward the datagram. At the destination computer, the Ethernet layer or another network interface passes the IP datagram to the IP layer, which removes the IP header. Information in the header tells the computer what protocol layer, such as TCP or UDP, should receive the datagrams message. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 249

The Internet Protocol performs two major functions. It defines a way to specify source and destination addresses for use with any network interface and across networks that use different interfaces. It enables a datagram to pass through networks of varying capabilities by defining a protocol that allows a router to fragment, or divide, a datagram into multiple, smaller datagrams and enables the destination to reassemble the original message from the fragments. Two things IP doesnt provide are flow control and error checking of the data payload. When needed, a higherlevel protocol such as TCP can provide these. For local communications, Ethernet frames also provide error checking. Two protocols can help in matching an IP address to a 250 computer, or to be more precise, to aUNIT network

interface. EMBEDDED NETWORKS; III: Ethernet Basics The expected replacement for IPv4 is IP version 6 (IPv6), which greatly increases the number of available IP addresses and adds other improvements for more efficient and secure transfers. IP Addresses: A computer that uses the Internet Protocol must have an IP address. A network administrator may manually assign an IP address to each computer or the network may have a way of assigning addresses automatically to computers that connect to the network. Assigning Addresses Each IP datagram includes the IP addresses of the datagrams source and destination. A computers IP address must be

unique within the network or networks that the computer can communicate with. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 251 In a local network with no direct connection to other networks, the address only needs to be different from the other addresses in the local network. In theory an isolated local network could use any IP addresses, but IP standard reserves three blocks of addresses for local use. An ISP in turn obtains the right to use addresses via a system that involves a variety of organizations that manage the allocating and assigning of addresses. At the top is the Internet Corporation for Assigned Names and Numbers (ICANN), at www.icann.org. ICANN is a non-profit corporation that manages the top-level assigning and allocating of IP addresses.

ICANN also manages the Internets domain name system, the root server system that supports the domain name system, and 252 NETWORKS; UNIT III: Ethernet Basics the assigning of numbers toEMBEDDED Internet protocols. Under ICANN are several regional registries that manage the assigning and allocating of IP addresses in specific geographic areas. For example, the American Registry for Internet Numbers (ARIN) at www.arin.net allocates and assigns Internet addresses in North and South America and a few other areas. The regional registries assign and allocate addresses to some large end users and Internet Service Providers (ISPs). The ISPs may in turn assign some of their allocated addresses to end users and may allocate blocks of addresses to other ISPs, who may assign and allocate their addresses, and so on

down the line. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 253 The Network Address and Host Address Each IP address has two parts: a network address, which is the same for all of the interfaces in the network, and a host address, which is unique to the interface within the network. The leftmost bits of the IP address are the network address and the rightmost bits are the host address. Routers use network addresses to help in determining where to forward received datagrams. The hosts in a local network are generally located near each other physically. So a router can have a table entry that tells the router to forward all datagrams directed to a specific network address to a router that is physically closer to the network. Without network addresses, routers would have to have a separate entry for each IP address, which would quickly

become unmanageable. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 254 The number of bits allocated to the network address and host address depends on the networks size. A network with a 24-bit network address and 8-bit host addresses can have up to 254 hosts. To keep from running out of available IP addresses, network addresses should be as long as possible while still enabling every host on the Internet to have a unique host address. If every network had an 8-bit network address, there could be no more than 254 networks on the Internet. But if every network had a 24-bit network address, each network could have no more than 254 hosts. There are two protocols for assigning network addresses on the Internet. The original protocol, called classful addressing, defines three network classes with network addresses of 8, 16, and 24 bits.

By examining the first three bits of the IP address, a router can determine what class of network the host belongs to, and thus how many bits make up the network address. 255 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Many networks with classful addressing are also divided into sub-networks, or subnets. For each subnet, the routers in the local network store an additional 32-bit value called the subnet mask, which enables routers to determine which subnet a datagram is directed to. A newer, more flexible and efficient alternative to classful addressing is classless addressing, where a network address can be any number of bits. A value called the IP prefix, or network prefix, specifies the number of bits in the network address. Routers that support classless addressing use the IP prefixes

in determining where to forward datagrams. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 256 Classful Addressing Table below shows the five network classes defined by RFC0791 for classful addressing. Network Class Most Significant Bit(s) in Network Address Range of

Most Significant Byte in Network Address A 0 1-126 1 126 3 16 million+

B 10 128-191 2 16,384 2 65,534 C 110

192-223 3 2 million+ 1 254 D 1110 224-239 reserved for multicasting E

1111 240-255 reserved for future use Number of Number Maximum Bytes in of Bytes Number of Network in Host Networks Address Address

Maximum Number of Hosts EMBEDDED NETWORKS; UNIT III: Ethernet Basics 257 The most significant bits of an IP address indicates the class of the network the host belongs to and how many bytes make up the network address. Class can be identified from the decimal value of the first byte or from the binary value of the few most significant bits. In a Class A network, the first byte is between 1 and 126, and the most significant bit is 0. The network address is 1 byte, leaving three bytes for the host address. There can be up to 126 Class A networks. In a Class B network, the first byte is between 128 and 191, and the two most significant bits are 10.

The network address is 2 bytes, leaving two bytes for the host address. There can be up to 65,534 Class B networks. In a Class C network, the first byte is between 192 and 223, and the three most significant bits are 110. The network address is 3 bytes, leaving 1 byte for the host address. There can be up to 16,777,214EMBEDDED Class CNETWORKS; networks. 258 UNIT III: Ethernet Basics In a Class D network, the first byte is between 224 and 239, and the four most significant bits are 1110. In a Class E network, the first byte is between 240 and 255, and the four most significant bits are 1111. Class E is reserved for future use. Using Subnets Subnetting is the process of dividing a network into groups called sub-networks, or subnets.

The hosts within a subnet are typically physically near each other and may belong to the same department or facility within an organization. In the same way that routers use network addresses to decide where to route traffic on the Internet, routers can use subnet IDs to decide where to route traffic within a network. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 259 A small, isolated local network doesnt have to concern itself with subnets. A large local network might use subnets for easier routing of messages. A public IP address obtained from an ISP is likely to be in a subnet, so even if your embedded system is in a small network, if the system connects to the Internet, public IP address is likely to be in a subnet. Besides helping in routing, subnetting helps to solve the shortage of available network addresses.

With only three general-purpose network classes, many organizations requesting network addresses would have to request much larger blocks of addresses than needed. For example, a network of 300 hosts is too large for Class C, but with a Class B address, tens of thousands of addresses would be unused. With subnets, a 300-host network can reserve a portion of a Class B network, leaving the remaining addresses for other subnets. 260 EMBEDDED NETWORKS; UNIT III: Ethernet Basics In a subnet, the host-address portion of an IP address has two parts: a subnet ID and a host ID.

The subnet ID is the same for all hosts in the subnet, while each host ID is unique in the subnet. The network-address portion of the IP address is the same for all of the hosts in all of the subnets in the network. A subnet ID can be any combination of bits in the hostaddress portion of the IP address, but in practice its almost always the most significant bits. The figure below shows an example. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 261 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 262 Three Ethernet networks are subnets in a Class B network. A hub in each subnet connects to a router that enables the computers in the subnets to communicate with computers in

other subnets and on the Internet. In each of the IP addresses, the first two bytes (172.16) are the network address, the third byte is the subnet ID (1, 2, or 3), and the fourth byte is the host ID. A subnet ID may use any number of the bits in the host address. For example, a Class C network that uses four bits for the subnet mask can have up to 14 subnets (24-2) and each subnet can have up to 14 hosts. The Subnet Mask: Determining which bits in the host address are the subnet ID requires using a 32-bit value called the subnet mask. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 263 In the subnet mask, the bits that correspond to the bits in the network address and the subnet ID are ones, and the bits that correspond to the bits in the host ID are zeros. For example, in a Class B network, two bytes are the network

address and two bytes are the host address. The subnet mask for a Class B network with eight bits of subnet ID is: 255.255.255.0 With eight bits of subnet ID, the network can have up to 254 subnets, and each subnet can have up to 254 hosts. In a similar way, the subnet mask for a Class C network with four bits of subnet ID is: 255.255.255.240 (Decimal 240 equals binary 11110000.) Program code can use the subnet mask to determine if a destination address is in the same subnet. To do so, perform a logical AND of the destination address and the subnet mask and compare the result to a logical AND of the host address and the subnet mask. If the values match, the destination is in the same subnet. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 264 Classless Addressing With classless addressing, the network address and IP prefix are often expressed in the form:

xxx.xxx.xxx.xxx/n where xxx.xxx.xxx.xxx is the lowest IP address in the network and n is the number of bits in the network-address portion of the IP address. For example, with a network address and IP prefix of 192.0.2.0/24, the network address is 192.0.2 (three bytes, or 24 bits), and the final eight bits in the IP address are the host address. In routing datagrams for addresses that use classless addressing, routers use Classless Inter-domain Routing (CIDR) protocols defined in RFC 1519. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 265 Example 1 Source address = 192.168.0.229 Source subnet mask = 255.255.255.224 Destination address = 192.168.0.253

Subnet mask AND Destination address =192.168.0.224 Subnet mask AND Source address = 192.168.0.224 192.68.0.224 XOR 192.68.0.224 = 0.0.0.0 The values match, so the destination address and the host are in the same subnet. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 266 Example 2 Source address = 10.2.1.3 Source subnet mask = 255.255.0.0 Destination address = 10.1.2.1 Subnet mask AND Destination address = 10.1.0.0 Subnet mask AND Source address = 10.2.0.0 10.1.0.0 XOR 10.2.0.0 = 0.3.0.0 The values dont match, so the source and destination are not in the same subnet.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 267 IP Addresses Reserved for Special Uses Some IP addresses are reserved for special uses. A network address or host address can never be all zeros or all ones. So, for example, in a network with an IP address and IP prefix of 192.0.2.0/24, the hosts can have a host address of any value from 1 to 254, but not 0 or 255. There is no network at 255.255.255 or 0.0.0.0. The Local Host The address 0.0.0.0 refers to the local host or network, also called this host or network. In a network with a DHCP server, a host sends a datagram with a source address of 0.0.0.0 to request the server to assign an IP address. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

268 Broadcast Addresses A destination address of all ones is a broadcast to all hosts in a network or subnet. A destination of 255.255.255.255 would appear to be a broadcast to the entire Internet, but in fact, Internet routers and most other routers ignore broadcasts, so the datagram only goes to the hosts in the local network or subnet. Individual hosts may also be configured to accept or ignore broadcasts. A broadcast can also specify a network or subnet, with the host address and subnet ID, if any, set to all ones. For example, a network with this network address and IP prefix: 192.168.100.0/28 can have up to 14 hosts (192.168.100.241 through 192.168.100.254) And a broadcast to: 192.168.100.255

is directed to all hosts in the network. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 269 Loopback Addresses Addresses with the most significant byte equal to 127 are loopback addresses reserved for loopback tests.

On receiving data to transmit to a loopback address, the IP layer passes the data back up to the source instead of passing the datagram down for transmitting on the network. Multicasting Another option for sending datagrams to multiple hosts is multicasting, where a source addresses a datagram to a specific group of hosts that may reside in different networks and subnets. Uses for multicasting include sending audio and video to subscribers. Classful addressing reserves the Class D addresses for multicasting. In practice, multicasting on the Internet has been uncommon because all routers between the source and destination must support multicasting, and many routers dont. Multicasting is feasible within local networks. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 270 Local Addresses (165)

In a local network that doesnt connect to the Internet, the IP addresses only have to be unique within the local network. An address range in each class is reserved for local networks that dont communicate with outside networks: Class A: 10.0.0.0 to 10.255.255.255 Class B: 172.16.0.0 to 172.31.255.255 Class C: 192.168.0.0 to 192.168.255.255 The addresses are for use within networks where the network administrator can ensure that no two hosts have the same address. A network that uses addresses in these ranges should not connect directly to the Internet or to another local network that might use the same addresses. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 271 The IP Header An IPv4 header has twelve required fields and optional IP Options

fields that precede the data, or message, being sent. Table below shows the fields in an IP header. Field Number of Bits Description Version Internet Header Length 4 4 Type of Service 8 Total Length

Identification Flags Fragment Offset Time to Live Protocol Header Checksum Source Address Destination Address 16 16 3 13 8 8 16 32 32

IP version being used Total length of the header in 32-bit words Suggestions as to the importance of minimizing delay, maximizing throughput, and maximizing reliability in routing Total length of the datagram in bytes Identifier for use in reassembling fragments Information used in fragmenting Position of a fragment in units of 64 bits Maximum time or number of router hops a datagram may live Protocol identifier for the data portion of the datagram Error-checking value for the header IP address of source IP address of destination Additional information for security, routing, identification, and/or time stamping Options (optional) varies

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 272 These are the functions of the fields in an IP Header. Version The Internet Protocol has been through various revisions over the years. RFC0791, dated 1981, describes IP version 4, which is the version in popular use at this writing. Replacing IPv4 is IPv6, described in RFC2460. The field is 4 bits. Header Length The Header Length is the length of the datagrams header in 4-byte words. The length of the header can vary because of the optional IP Options field. The required fields use 20 bytes (for a Header Length of 5), and IP Options can use up to 40 additional bytes (for a Header

Length of 15). The field is 4 bits. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 273 Type of Service The Type of Service bits offer a way for the sending process to advise routers how to handle the segment. The options are to maximize reliability, minimize delay, maximize throughput, or minimize cost. Routers may ignore these bits. The field is 8 bits. Total Length of Datagram The Total Length of Datagram field is the length of the header plus the data payload in bytes. The maximum is 65,535 bytes. The field is 16 bits. Datagram Identification The host that originates the datagram assigns a unique Datagram Identification value to the datagram. If a router fragments the datagram as it travels to its destination, each

fragment will have the same Datagram Identification value. This field is 16 bits. 274 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Flags Two bits in the Flags field relate to fragmenting. Bit 0 is unused. Bit 1: Dont Fragment. If this bit is 1, routers should not fragment the datagram. If possible, a router should route the datagram to a network that can accept the datagram in one piece. Otherwise, the router discards the datagram nd may return an error message indicating that the destination is unreachable. The IP standard requires hosts to accept datagrams of up to 576 bytes, so if the datagram may pass through unknown hosts and user want to be sure it will not be discarded due to size, use datagrams of 576 bytes or less. Bit 2: More Fragments. When this bit is 1, the datagram is a

fragment, but not the last fragment of the fragmented datagram. When the bit is 0, the datagram isnt fragmented or its the final fragment EMBEDDED NETWORKS; UNIT III: Ethernet Basics 275 Fragment Offset The Fragment Offset field identifies the location of a fragment in a fragmented datagram. The value is in units of eight bytes, with a maximum of 8191, which corresponds to a 65,528-byte offset. For example, to send 1024 bytes in two fragments of 576 and 424 bytes, the first fragment has a Fragment Offset of 0 and the second fragment has a Fragment Offset of 72 (because 72*8 = 576). The field is 13 bits. Time to Live If a datagram doesnt reach its destination in a reasonable

time, the network discards it. The Time to Live field determines when its time to discard a datagram. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 276 Time to Live expresses the time remaining for the datagram, with each router decrementing the value by 1 or the number of seconds needed to process and forward the datagram, whichever is greater. In practice, routers typically take less than one second to process and forward a datagram, so instead of measuring time, the value measures the number of hops, or network segments between routers. The computer sending the datagram sets the initial value. The field is 8 bits. Protocol The Protocol field specifies the protocol used by the

datagrams data payload so the IP layer will know where to pass received data. The field is 8 bits. 277 EMBEDDED NETWORKS; UNIT III: Ethernet Basics Header Checksum The Header Checksum enables the receiver of a datagram to check for errors in the IP header only, not including the contents of the data area, or message. The checksum is calculated on the values in the header, with the Header Checksum bits assumed to be zero. Error checking of the message is required in Ethernet frames and TCP segments and optional in UDP datagrams. To calculate a checksum on an IP header, do the following 1. Divide the header into a series of 16-bit words. 2. Add the first two words. If the result has a carry bit (if the result is greater than FFFFh), drop the carry bit and add

1 to the sum. 3. Add the next 16-bit word to the sum. Again, if the value has a carry bit, drop the carry bit and add 1 to the sum. 278 EMBEDDED NETWORKS; UNIT III: Ethernet Basics 4. Repeat step 3 until all of the 16-bit words have been added in. 5. Find the ones complement of the result. To obtain the ones complement, in the binary value, change each 0 to 1 and change each 1 to 0. The result is the checksum. Source IP Address The Source IP Address identifies the sender of the datagram. The receiver of a datagram can use this field to find out where to send a reply. The field is 32 bits. Destination IP Address The Destination IP Address identifies the destination of the datagram.

The field is 32 bits. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 279 Assigning an IP Address to a Host A network may use any of a variety of ways of assigning IP addresses to its hosts. One approach is to have a network administrator configure the address at each host. But often, it makes more sense to have a single location in charge of assigning IP addresses. The Dynamic Host Configuration Protocol (DHCP) defines three ways of doing this. DCHP: Three Options The alternatives described in Dynamic Host Configuration Protocol are manual, automatic, and dynamic allocation. The table shown below compares the capabilities of the Dynamic Host Configuration Protocol (DHCP)s methods and manual assignment at the individual hosts.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 280 Method of Stores Assigning IP Addresses in Addresses a Single Server? Per Host Manual DHCP Manual DHCP Automatic DHCP Dynamic

Method of Adding a Host Method of Requires the Removing a Host to Host Renew Its Lease Period ically? no manual manual

no yes manual manual no yes automatic manual no yes

automatic automatic yes EMBEDDED NETWORKS; UNIT III: Ethernet Basics 281 All three DHCP methods require a computer that functions as a DHCP server. The other computers in the network are DHCP clients, which request IP addresses from the server. The server uses one of the three methods in responding to the requests. On connecting to the network, a DHCP client uses UDP to broadcast a DHCPDISCOVER message to request an assigned IP address.

Because the host doesnt have an IP address yet, it uses a source IP address of 0.0.0.0 in the request. The server must have another way of identifying the sender of the message. In an Ethernet network, the server can use the hardware address in the Source Address field of the Ethernet frame. The DHCP server responds to the DHCPDISCOVER message by returning an IP address to the requesting host, which uses 282 EMBEDDED NETWORKS; UNIT III: Ethernet Basics the new address in future communications. Manual Allocation In manual allocation, the network administrator specifies an address for each host, but instead of configuring the addresses at each host, the administrator configures all of the addresses at the DHCP server. On receiving a DHCPDISCOVER message, the DHCP server returns the address assigned to the requesting host. For example, in an Ethernet network, the network administrator

can provide the server with a table that matches an IP address to the Ethernet hardware address of each Ethernet controller in the network. The DHCP server reads the sources Ethernet address from the Ethernet frame, finds the corresponding IP address in the table, and returns the address to the requesting hosts Ethernet address. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 283 Manual allocation is more convenient than configuring an address at each host, but the allocation still requires the administrator to know each hosts hardware address and to assign an address every time the network gains a new host. Automatic Allocation In automatic allocation, instead of maintaining a table of values matched to hardware addresses, the DHCP server begins with a list of available IP addresses.

On receiving a DHCPDISCOVER message, the server selects any unassigned address to return to the requesting host and marks the address in the table as assigned to that host. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 284 Dynamic Allocation One thing that automatic allocation doesnt define is a way to reclaim addresses that are no longer in use. Reclaiming addresses is essential in networks that have more potential hosts than available IP addresses. For example, the hosts connected to an ISP at any one time will vary as different customers go on and off line. If the ISP assigns a permanent, or static, address to every computer that connects, it will eventually run out of addresses, even if only a few customers connect at once. A solution is to use dynamic allocation, which reclaims IP

addresses that are no longer in use. As with automatic allocation, in dynamic allocation, the DHCP server begins with a list of available IP addresses and returns addresses in response to DHCPDISCOVER messages. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 285 Instead of assigning a permanent address, the server leases the address to the client for a specified time. To keep an address, the client must periodically send a request to renew the lease. If the client disconnects from the network or for any other reason fails to renew its lease, the server is free to assign the address to another computer. A client may request an infinite lease or suggest a lease time, but servers arent required to comply with these requests. The lease time is a 32-bit value in seconds, with FFFFFFFFh indicating an infinite lease. On receiving a request for an IP address, a DHCP server uses

the previously assigned address for that host if available. A computer can also request a specific IP address. But with dynamic allocation, there is no guarantee that arequest for an IP address will return a specific value. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 286 For some small embedded systems, it may be easier to store a static IP address in firmware. The DHCP server must then be configured to reserve this address. Each network may have its own DHCP server, or multiple networks may use relay agents to share a DHCP server. A relay agent accepts DHCPDISCOVER messages from hosts in a network and sends the messages to a DHCP server. The server replies to the relay agent, which then sends the message to the host that requested it. In a network that has a NAT router that connects to a cable modem or DSL modem, the router typically can function as a

DHCP server for the local network and as a DHCP client for the public network. The server can assign addresses to the hosts in the local network. The client enables the router to request an IP address from a DHCP server at the ISP. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 287 Windows XP can function as a DHCP client for a server at an ISP or other location. Using Internet Connection Sharing, Windows XP can function as a DHCP server that assigns IP addresses to computers in a local network. Considerations when Using Dynamic IP Addresses When a domains IP address changes, the DHCP server or other entity that changed the address must send an updated resource record to the domains name servers. If an ISP uses DHCP in assigning networks public IP address and an embedded system has a domain name, domains name servers has to be updated when the systems IP address

changes. A way to achieve this is by using a service that handles the updates automatically. One provider of this service is Tzolkin Corporation. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 288 To use Tzolkins service with an embedded system, a PC is required in the same local network as the embedded system, and both computers must share a public IP address. At the registrar where the domain has been registered, the registration must change to indicate that Tzolkins name servers are the name servers for our domain. On a PC that shares the embedded systems public IP address, run Tzolkins application, which monitors the PCs current public IP address. When the address changes, the application automatically informs the name servers of the change. For best results, the

PC running the Tzolkin application should be on line all of the time. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 289 Matching an IP Address to an Ethernet Interface Every IP datagram must include the IP address of its destination. A host can use a variety of ways to learn the IP address of a destination the host wants to communicate with. A network administrator can provide each host with the IP addresses the host will communicate with. The hosts will need a way to update their lists when a host is added, removed, or changes its address, but if changes are rare, the updates can be done manually. Some computers only need to reply to received communications using the source address in received datagrams. For example, a host that functions as a Web server that sends

Web pages on request only needs to respond to received requests that include the IP address to reply to. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 290 A host that wants to request a Web page or other resource or send other communications over the Internet must know the destinations IP address. If a host knows only the domain name, a name resolver can query name servers to learn the IP address that corresponds to the domain name. Using ARP In a local network, the Address Resolution Protocol (ARP) can match an IP address with the Ethernet hardware address of the computer with that IP Address. The document that defines ARP is RFC 0826: An Ethernet Address Resolution Protocol: Or converting network protocol addresses to 48.bit Ethernet address for

transmission on Ethernet hardware, also available as standards-track document STD0037. 291 EMBEDDED NETWORKS; UNIT III: Ethernet Basics To learn the Ethernet hardware address that corresponds to an IP address, a host broadcasts an Ethernet frame containing an ARP packet. In the Ethernet header, the Type field contains 0806h, which indicates that the frame is carrying an ARP message. The destination address is all ones or a broadcast address for a specific network or subnet. In a similar way, a computer can broadcast a RARP (reverse ARP) request to learn the IP address that corresponds to a hardware address, including the computers own IP address. RARP is defined in RFC0903: A Reverse Address Resolution Protocol, also available as standards-track document 292 STD0038.

EMBEDDED NETWORKS; UNIT III: Ethernet Basics ARP and RARP Format ARP and RARP requests and replies transmit in the data fields of Ethernet frames. Each request or reply has nine fields. The purpose of each field is as follows: Hardware address space. Indicates the hardware interface being matched to a protocol address. Ethernet=0001h. 2 bytes. Protocol address space. Indicates the protocol being matched to a hardware address. IP=0800h (specified in RFC1010). 2 bytes. Length in bytes of a hardware address. Ethernet hardware addresses are 6 bytes. 1 byte. Length in bytes of a protocol address. IPv4 addresses are 4 bytes. 1 byte. Opcode. Indicates the operation to perform: 1=ARP request 2=ARP reply 3=RARP request 4=RARP reply (2 bytes).

EMBEDDED NETWORKS; UNIT III: Ethernet Basics 293 Source Ethernet hardware address. 6 bytes. Source IP address. 4 bytes. Destination Ethernet hardware address. For ARP requests, this value is undefined because its the value being requested. For ARP replies, this value contains the hardware address for the requests IP address. For RARP requests and replies, this value is the hardware address whose IP address is being requested. 6 bytes. Destination IP address. For RARP requests, this value is undefined because its the value being requested. For RARP replies, this value contains the IP address that corresponds to the requests hardware address. For ARP requests and replies, this value is the IP address whose hardware address is being requested. 4 bytes. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

294 How a Datagram Finds Its Way to Its Destination When a host wants to send a message and knows the IP address of its destination, its ready to send the IP datagram on the network. The IP address contains no information about the physical location of the destination. Direct Routing Messages whose destination is within the local subnet, or within the local network when there is no subnet, use direct routing. In direct routing in an Ethernet network, the originating host sends an IP datagram in an Ethernet frame that contains the destinations Ethernet hardware address. The originating host uses ARP if needed to learn the destinations hardware address. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

295 Within an Ethernet network, hosts connected by repeater hubs receive all valid frames sent by any of the hosts. An Ethernet switch forwards frames to a specific port if possible, and otherwise forwards the frame to all of the switchs ports. Indirect Routing Messages whose destination is outside the local subnet or network use indirect routing. With indirect routing, a designated default router accepts messages destined for outside the local subnet or network. An Ethernet network that connects to the Internet should have a default router for messages whose destination is outside the local network. For example, if a computer in an Ethernet network wants to send a message on the Internet, the computer places the message in an IP datagram in an Ethernet frame. The destination address in the Ethernet frame is the default routers hardware address. The default router uses the destination address in

the IP datagram to decide where to forward the datagram. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 296 To decide where to forward the datagram, the router first checks its internal forwarding table for a matching IP address. Each entry in the table has the IP address of the router that is the next hop, or the next router on the way, for datagrams going to a specific address, network, or subnet. A router builds its forwarding table by saving entries containing the source address of received datagrams and the router port that the datagram arrived on. To ensure that theres room for new entries, each entry has a timeout and is removed on timing out. No forwarding table will contain an entry that matches every received destination address, if only because a router may begin with no entries other than a default router. On receiving a datagram with a destination address that isnt in

the forwarding table, the router sends the datagram to another router designated as the first routers default router. EMBEDDED NETWORKS; UNIT III: Ethernet Basics 297 In a similar way, the router that receives the datagram looks for a match in its forwarding table and sends the segment on either to a destination found in its forwarding table or to another default router. An IP datagram may travel through a number of routers on the way to its destination. The source may have no way of knowing the maximum size of datagrams the routers or the destination can accept. If a datagram is too large for its destination, a router may send the data payload in multiple, smaller datagrams, with a portion, or fragment, of the data in each. On receiving the datagrams, the destination uses information in the IP header to put the fragments back together.

298 EMBEDDED NETWORKS; UNIT III: Ethernet Basics The Internet Control Message Protocol (ICMP) Hosts that support IP must also support the Internet Control Message Protocol (ICMP) defined by RFC 792: Internet Control Message Protocol. ICMP is a basic protocol for sending messages. Some common uses for ICMP are to send a PING message to learn if a host is available on the network and to obtain the IP addresses of local routers. ICMP messages travel in IP datagrams. The Protocol field in the IP header is 1 to indicate ICMP. The first byte in the data portion of the datagram is an ICMP Type code that determines the format of the data that follows. RFC 792, RFC 950, and RFC 1256 define the type codes listed in Table shown below. EMBEDDED NETWORKS; UNIT III: Ethernet Basics

299 The Internet Control Message Protocol (ICMP) Type Code 0 Message Type Echo Reply Description 3 Destination Unreachable 4

Source Quench 5 Redirect 8 Echo Responds to an Echo message (Ping). Not all hosts respond to Echo requests. Indicates that a datagram wont be delivered because the destination IP address is unreachable or unavailable or because the datagram doesnt allow fragmenting and must be fragmented to reach its destination. Requests a destination to reduce the traffic it is sending to a source. On receiving a datagram to forward, advises the source of a better router to use for that destination network in the future. Requests a reply from the destination (PING).

9 Router Advertisement Announces the availability of one or more routers (RFC1256). 10 Router Solicitation 11 Time Exceeded 12 Parameter Problem 13

Timestamp 14 Timestamp Reply 15 Information Request Requests Router Advertisements (RFC1256). Notifies that a datagram was discarded because the time-to-live field was zero or a fragmented datagram timed out before it could be reassembled. Returns information about a datagram that was discarded due to a problem in the information in the header. Provides a timestamp value containing the number of milliseconds since midnight in Universal Time or another, non-standard value. Returns the received timestamp value and a timestamp value containing the number of

milliseconds since midnight in Universal Time or another, non-standard value. The value indicates the amount of time the original Timestamp message required to reach the destination. Enables a host to discover its network address. Obsoleted by RARP. 16 Information Reply Enables a host to discover its network address. Obsoleted by RARP. 17 Address Mask Request Requests the local subnet mask (RFC 950). 18 Address Mask Reply

Returns the local subnet mask (RFC 950). EMBEDDED NETWORKS; UNIT III: Ethernet Basics 300

Recently Viewed Presentations