Вы находитесь на странице: 1из 24

February 2011 Master of Computer Application (MCA) Semester 3 MC0075 Computer Networks 4 Credit s (Book ID: B0813 &

p; B0814) Assignment Set 1 1. Discuss the advantages and disadvantages of synchronous and asynchronous transmi ssion. Ans: There are different ways of transmitting the information. In this section w e will study these various methods with their relative merits and demerits. Seri al & Parallel Serial communication is the sequential transmission of the signal elements of a group representing a character or other entity of data. The charac ters are transmitted in a sequence over a single line, rather than simultaneousl y over two or more lines, as in parallel transmission as shown in below figure. Serial transmission: one bit at a time The sequential elements may be transmitted with or without interruption. Paralle l communication refers to when data is transmitted byte-by-byte i.e., all bits o f one or more bytes are transmitted simultaneously over separate wires as shown in given figure. Parallel transmissions: Several bits at a time Most transmission lines are serial, whereas information transfer within computer s and communications devices is in parallel. Therefore, there must be tech-nique s for converting between parallel and serial, and vice versa. A Universal Asynch ronous Receiver Transmitter (UART) usually accomplishes such data conversions.

The comparisons of the serial and parallel transmission modes are listed in tabl e. S E R IAL M O D E COST SPEED TH ROUGHPUT U S ED IN PARALLEL MOD E Less costly (only one wire) Low ( only 1 bit at a time) Low Longer distance comm . More costly (many wires) High (more bits at a time) High Shorter distance comm.. Comparison of serial and parallel transmission mode Simplex, Half duplex & Full duplex Simplex refers to communications in only one direction from the transmitter to the receiver as shown in figure (a). There is no acknowledgement of reception from the receiver, so errors cannot be conveyed to the transmitter. Half-duplex refers to two-way communications but in only one direction at a time as shown in figure (b). (a) Simplex (b) Half Duplex (c) Full Duplex Full duplex refers to simultaneous two-way transmission as shown in figure (c). For example, a radio is a simplex device, a walkie-talkie is a half-duplex devic e, and certain computer video cards are full-duplex devices. Similarly, radio or TV broadcast is a simplex system, transfer of inventory data from a warehouse t o an accounting office is a half duplex system, and videoconferencing represents a full-duplex application. Full Duplex provides maximum function and performanc e. Synchronous & Asynchronous transmission Synchronous Transmission: Synchronous is any type of communication in which the parties communicating are "live" or p resent in the same space and time. A chat room where both parties must be at the ir computer, connected to the Internet, and using software to communicate in the chat room protocols is a synchronous method of communication. E-mail is an exam ple of an asynchronous mode of communication where one party can send a note

to another person and the recipient need not be online to receive the e-mail. Sy nchronous mode of transmissions are illustrated in shown figure SYNCHRONOUSSERIALDATA 7E7E 7E TAIL DATA DATAPACKET HEADER 7E7E 7E IdleLineState=7E Synchronous and Asynchronous Transmissions The two ends of a link are synchronized, by carrying the transmitters clock infor mation along with data. Bytes are transmitted continuously, if there are gaps th en inserts idle bytes as padding Advantage: This reduces overhead bits It overco mes the two main deficiencies of the asynchronous method, that of inefficiency a nd lack of error detection. Disadvantage: For correct operation the receiver mus t start to sample the line at the correct instant Application: Used in high spee d transmission example: HDLC Asynchronous transmission: Asynchronous refers to p rocesses that proceed independently of each other until one process needs to "in terrupt" the other process with a request. Using the client- server model, the s erver handles many asynchronous requests from its many clients. The client is of ten able to proceed with other work or must wait on the service requested from t he server.

ASYNCHRONOUSSERIALDATA 1 Stop Character Start IdleLineState=7E Asynchronous Transmissions synchronous mode of transmissions is illustrated in figure 3.12. Here a Start an d Stop signal is necessary before and after the character. Start signal is of sa me length as information bit. Stop signal is usually 1, 1.5 or 2 times the lengt h of the information signal Advantage: The character is self contained & Transmi tter and receiver need not be synchronized Transmitting and receiving clocks are independent of each other Disadvantage: Overhead of start and stop bits False r ecognition of these bits due to noise on the channel Application: If channel is reliable, then suitable for high speed else low speed transmission Most common u se is in the ASCII terminals Efficiency of transmission is the ratio of the actu al message bits to the total number of bits, including message and control bits, as shown in Equation 3.4. In any transmission, the synchronization, error detec tion, or any other bits that are not messages are collectively referred to as ov erheads, represented in Equation. 3.5. The higher are the overheads; the lower i s the efficiency of transmission, as shown in Equation 3.6. Efficiency = M/ (M+C ) x 100% (3.4) Overhead = (1 M/ (M+C)) x 100% (3.5) Where M = Number of message bits

C = Number of control bits In other words, Efficiency % = 100 -Overhead % (3.6) 2. Describe the ISO-OSI reference model and discuss the importance of every laye r. Ans: The OSI Reference Model: This reference model is proposed by International standard organization (ISO) as a a first step towards standardization of the pro tocols used in various layers in 1983 by Day and Zimmermann. This model is calle d Open system Interconnection (OSI) reference model. It is referred OSI as it de als with connection open systems. That is the systems are open for communication with other systems. It consists of seven layers. Layers of OSI Model The princi ples that were applied to arrive at 7 layers: 1. A layer should be created where a different level of abstraction is needed. 2. Each layer should perform a well defined task. 3. The function of each layer should define internationally stand ardized protocols 4. Layer boundaries should be chosen to minimize the informati on flow across the interface. 5. The number of layers should not be high or too small. The ISO-OSI reference model is as shown in figure 2.5. As such this model is not a network architecture as it does not specify exact services and protocols. It just tells what each layer should do and where it lies. The bottom most layer is referred as physical layer. ISO has produced standards for each layers and are published separately.

Each layer of the ISO-OSI reference model are discussed below: 1. Physical Layer This layer is the bottom most layer that is concerned with transmitting raw bit s over the communication channel (physical medium). The design issues have to do with making sure that when one side sends a 1 bit, it is received by other side as a 1 bit, and not as a 0 bit. It performs direct transmission of logical info rmation that is digital bit streams into physical phenomena in the form of elect ronic pulses. Modulators/demodulators are used at this layer. The design issue h ere largely deals with mechanical, electrical, and procedural interfaces, and th e physical transmission medium, which lies below this physical layer. In particu lar, it defines the relationship between a device and a physical medium. This in cludes the layout of pins, voltages, and cable specifications. Hubs, repeaters, network adapters and Host Bus Adapters (HBAs used in Storage Area Networks) are physical-layer devices. The major functions and services performed by the physic al layer are: Establishment and termination of a connection to a communications medium. Participation in the process whereby the communication resources are eff ectively shared among multiple users. For example, contention resolution and flo w control. Modulation, is a technique of conversion between the representation o f digital data in user equipment and the corresponding signals transmitted over a communications channel. These are signals operating over the physical cabling (such as copper and fiber optic) or over a radio link. Parallel SCSI buses opera te in this layer. Various physical-layer Ethernet standards are also in this lay er; Ethernet incorporates both this layer and the data-link layer. The same appl ies to other local-area networks, such as Token ring, FDDI, and IEEE 802.11, as well as personal area networks such as Bluetooth and IEEE 802.15.4. 2. Data Link Layer The Data Link layer provides the functional and procedural means to trans fer data between network entities and to detect and possibly correct errors that may occur in the Physical layer. That is it makes sure that the message indeed reach the other end without corruption or without signal distortion and noise. I t accomplishes this task by having the sender break the input data up into the f rames called data frames. The DLL of transmitter, then transmits the frames sequ entially, and processes acknowledgement frames sent back by the receiver. After processing acknowledgement frame, may be the transmitter needs to re-transmit a copy of the frame. So therefore the DLL at receiver is required to detect duplic ations of frames.

The best known example of this is Ethernet. This layer manages the interaction o f devices with a shared medium. Other examples of data link protocols are HDLC a nd ADCCP for pointto-point or packet-switched networks and Aloha for local area networks. On IEEE 802 local area networks, and some non-IEEE 802 networks such a s FDDI, this layer may be split into a Media Access Control (MAC) layer and the IEEE 802.2 Logical Link Control (LLC) layer. It arranges bits from the physical layer into logical chunks of data, known as frames. This is the layer at which t he bridges and switches operate. Connectivity is provided only among locally att ached network nodes forming layer 2 domains for unicast or broadcast forwarding. Other protocols may be imposed on the data frames to create tunnels and logical ly separated layer 2 forwarding domain. The data link layer might implement a sl iding window flow control and acknowledgment mechanism to provide reliable deliv ery of frames; that is the case for SDLC and HDLC, and derivatives of HDLC such as LAPB and LAPD. In modern practice, only error detection, not flow control usi ng sliding window, is present in modern data link protocols such as Point-toPoin t Protocol (PPP), and, on local area networks, the IEEE 802.2 LLC layer is not u sed for most protocols on Ethernet, and, on other local area networks, its flow control and acknowledgment mechanisms are rarely used. Sliding window flow contr ol and acknowledgment is used at the transport layers by protocols such as TCP. 3. Network Layer The Network layer provides the functional and procedural means of transferring variable length data sequences from a source to a destination vi a one or more networks while maintaining the quality of service requested by the Transport layer. The Network layer performs network routing functions, and migh t also perform fragmentation and reassembly, and report delivery errors. Routers operate at this layer sending data throughout the extended network and making t he Internet possible. This is a logical addressing scheme values are chosen by t he network engineer. The addressing scheme is hierarchical. The best known examp le of a layer 3 protocol is the Internet Protocol (IP). Perhaps its easier to vis ualize this layer as managing the sequence of human carriers taking a letter fro m the sender to the local post office, trucks that carry sacks of mail to other post offices or airports, airplanes that carry airmail between major cities, tru cks that distribute mail sacks in a city, and carriers that take a letter to its destinations. Think of fragmentation as splitting a large document into smaller envelopes for shipping, or, in the case of the network layer, splitting an appl ication or transport record into packets. The major tasks of network layer are l isted It controls routes for individual message through the actual topology.

Finds the best route. Finds alternate routes. It accomplishes buffering and dead lock handling. 4. Transport Layer The Transport layer provides transparent trans fer of data between end users, providing reliable data transfer while relieving the upper layers of it. The transport layer controls the reliability of a given link through flow control, segmentation/de-segmentation, and error control. Some protocols are state and connection oriented. This means that the transport laye r can keep track of the segments and retransmit those that fail. The best known example of a layer 4 protocol is the Transmission Control Protocol (TCP). The tr ansport layer is the layer that converts messages into TCP segments or User Data gram Protocol (UDP), Stream Control Transmission Protocol (SCTP), etc. packets. Perhaps an easy way to visualize the Transport Layer is to compare it with a Pos t Office, which deals with the dispatch and classification of mail and parcels s ent. Do remember, however, that a post office manages the outer envelope of mail . Higher layers may have the equivalent of double envelopes, such as cryptograph ic Presentation services that can be read by the addressee only. Roughly speakin g, tunneling protocols operate at the transport layer, such as carrying non-IP p rotocols such as IBMs SNA or Novells IPX over an IP network, or end-to-end encrypt ion with IP security (IP sec). While Generic Routing Encapsulation (GRE) might s eem to be a network layer protocol, if the encapsulation of the payload takes pl ace only at endpoint, GRE becomes closer to a transport protocol that uses IP he aders but contains complete frames or packets to deliver to an endpoint. The maj or tasks of Transport layer are listed below: It locates the other party It crea tes a transport pipe between both end-users. It breaks the message into packets and reassembles them at the destination. It applies flow control to the packet s tream. 5. Session Layer The Session layer controls the dialogues/connections (se ssions) between computers. It establishes, manages and terminates the connection s between the local and remote application. It provides for either full-duplex o r half-duplex operation, and establishes check pointing, adjournment, terminatio n, and restart procedures. The OSI model made this layer

responsible for "graceful close" of sessions, which is a property of TCP, and al so for session check pointing and recovery, which is not usually used in the Int ernet protocols suite. The major tasks of session layer are listed It is respons ible for the relation between two end-users. It maintains the integrity and cont rols the data exchanged between the end-users. The end-users are aware of each o ther when the relation is established (synchronization). It uses naming and addr essing to identify a particular user. It makes sure that the lower layer guarant ees delivering the message (flow control). 6. Presentation Layer The Presentatio n layer transforms the data to provide a standard interface for the Application layer. MIME encoding, data encryption and similar manipulation of the presentati on are done at this layer to present the data as a service or protocol developer sees fit. Examples of this layer are converting an EBCDIC-coded text file to an ASCII-coded file, or serializing objects and other data structures into and out of XML. The major tasks of presentation layer are listed below: It translates t he language used by the application layer. It makes the users as independent as possible, and then they can concentrate on conversation. 7. Application Layer (e nd users) The application layer is the seventh level of the seven-layer OSI mode l. It interfaces directly to the users and performs common application services for the application processes. It also issues requests to the presentation layer . Note carefully that this layer provides services to user-defined application p rocesses, and not to the end user. For example, it defines a file transfer proto col, but the end user must go through an application process to invoke file tran sfer. The OSI model does not include human interfaces. The common application se rvices sub layer provides functional elements including the Remote Operations Se rvice Element (comparable to Internet Remote Procedure Call), Association Contro l, and Transaction Processing (according to the ACID requirements). Above the co mmon application service sub layer are functions meaningful to user application programs, such as messaging (X.400), directory (X.500), file transfer (FTAM), vi rtual terminal (VTAM), and batch job manipulation (JTAM).

A Comparison of OSI and TCP/IP Reference Models Concepts central to the OSI mode l are: Services: It tells what the layer does. Interfaces: It tells the processe s above it how to access it. It specifies what parameters are and what result to expect. Protocols: It provides the offered service. It is used in a layer and a re layers own business. The TCP/IP did not originally distinguish between the se rvice, interface & protocols. The only real services offered by the internet lay er are SEND IP packets and RECEIVE IP packets. The OSI model was devised before the protocols were invented. Data link layer originally dealt only with point-to -point networks. When broadcast networks came around, a new sublayer had to be h acked into the model. With TCP/IP the reverse was true, the protocols came first and the model was really just a description of the existing protocols. This TCP /IP model did fit any other protocol stack. Then OSI model has seven layers and TCP/IP has four layers as shown in figure below Comparisons of the two reference models Another difference is in the area of con nectionless and connection oriented services. The OSI model supports both these services in the network layer but supports only connection oriented communicatio n in the transport layer. Where as the TCP/IP has supports only connection less communication in the network layer, and supports both these services in the tran sport layer. A Critique of the OSI Model and Protocols Why OSI did not take over the world Bad timing

Bad technology Bad implementations Bad politics A Critique of the TCP/IP Referen ce Model Problems: Service, interface, and protocol not distinguished Not a gene ral model Host-to-network layer not really a layer No mention of physical and data link layers Minor protocols deeply entrenched, hard to replace Network standard ization Network standardization is a definition that has been approved by a reco gnized standards organization. Standards exist for programming languages, operat ing systems, data formats, communications protocols, and electrical interfaces. Two categories of standards: De facto (Latin for from the fact) standards: These a re those that have just happened without any formal plan. These are formats that have become standard simply because a large number of companies have agreed to use them. They have not been formally approved as standards E.g., IBM PC for sma ll office computers, UNIX for operating systems in CS departments. PostScript is a good example of a de facto standard. De jure (Latin for by law) standards: Thes e are formal legal standards adopted by some authorized standardization body. Tw o classes of standard organizations Organizations established by treaty among na tional governments. Voluntary, nontreaty organizations. From a users standpoint, standards are extremely important in the computer industry because they allow th e combination of products from different manufacturers to create a customized sy stem. Without standards, only hardware and software from the same company

could be used together. In addition, standard user interfaces can make it much e asier to learn how to use new applications. Most official computer standards are set by one of the following organizations: ANSI (American National Standards In stitute) ITU (International Telecommunication Union) IEEE (Institute of Electric al and Electronic Engineers) ISO (International Standards Organization) VESA (Vi deo Electronics Standards Association) Benefits of standardization: Allow differ ent computers to communicate. Increase the market for products adhering to the s tandard. Whos who in the telecommunication world? Common carriers: private teleph one companies (e.g., AT&T, USA). PTT (Post, Telegraph & Telephone) administratio n: nationalized telecommunication companies (most of the world). ITU (Internatio nal Telecommunication Union): an agency of the UN for international telecommunic ation coordination. CCITT (an acronym for its French name): one of the organs of ITU (i.e., ITU-T), specialized for telephone and data communication systems. 3. Explain the following with respect to Data Communications: A) Fourier analysis Ans: In 19th century, the French mathematician Fourier proved that any periodic function of time g (t) with period T can be constructed by summing a number of c osines and sines. Where f=1/T is the fundamental frequency, and are the sine and cosine amplitudes of the nth harmonics. Such decomposition is called a Fourier series. B) Band li mited signals

Ans: Consider the signal given in figure below. Figure shows the signal that is the ASCII representation of the character b which consists of the bit pattern 01100 010 along with its harmonics. Any transmission facility cannot pass all the harmonics and hence few of the har monics are diminished and distorted. The bandwidth is restricted to low frequenc ies consisting of 1, 2, 4, and 8 harmonics and then transmitted. Figures show th e spectra and reconstructed functions for these band-limited signals. Limiting t he bandwidth limits the data rate even for perfect channels. However complex cod ing schemes that use several voltage levels do exist and can achieve higher data rates. C) Maximum data rate of a channel Ans: In 1924, H. Nyquist realized the existence of the fundamental limit and der ived the equation expressing the maximum data for a finite bandwidth noiseless c hannel. In 1948, Claude Shannon carried Nyquist work further and extended it to the case of a channel subject to random noise. In communications, it is not real ly the amount of noise that concerns us, but rather the amount of noise compared to the level of the desired signal. That is, it is the ratio of signal to noise power that is important, rather than the noise power alone. This Signal-to-Noise Ratio (SNR), usually expressed in decibel (dB), is one of the most important sp ecifications of any communication system. The decibel is a logarithmic unit used for comparisons of power levels or voltage levels. In order to understand the i mplication of dB, it is important to know that a sound level of zero dB correspo nds to the threshold of hearing, which is the smallest sound that can be heard. A normal speech conversation would measure about 60 dB. If an arbitrary signal i s passed through the Low pass filter of bandwidth H, the filtered signal can be completely reconstructed by making only 2H samples per second. Sampling the line

faster than 2H per second is pointless. If the signal consists of V discrete lev els, then Nyquist theorem states that, for a noiseless channel Maximum data rate = 2H.log2 (V) bits per second. (3.2) For a noisy channel with bandwidth is agai n H, knowing signal to noise ratio S/N, the maximum data rate according to Shann on is given as Maximum data rate = H.log2 (1+S/N) bits per second. (3.3) 4. Expl ain the following concepts of Internetworking: A) Internet architecture Ans: Internet Architecture: B1-226, B2-56: The Internet is a worldwide, publicly accessible network of interconnected computer networks that transmit data by pa cket switching using the standard Internet Protocol (IP). It is a "network of ne tworks" that consists of millions of smaller domestic, academic, business, and g overnment networks, which together carry various information and services, such as electronic mail, online chat, file transfer, and the interlinked web pages an d other documents of the World Wide Web. How are networks interconnected to form an internetwork? The answer has two parts. Physically, two networks can only be connected by a computer that attaches both of them. But just a physical connect ion cannot provide interconnection where information can be exchanged as there i s no guarantee that the computer will cooperate with other machines that wish to communicate. Internet is not restricted in size. Internets exist that contain a few networks and internets also exist that contain thousands of networks. Simil arly the number of computers attached to each network in an internet can vary. S ome networks have no computers attached, while others have hundreds. To have a v iable internet, we need a special computer that is willing to transfer packets f rom one network to another. Computers that interconnect two networks and pass pa ckets from one to the other are called internet gateways or internet routers. B) Protocols and Significance for Internetworking

Ans: Protocols for internetworking: Many protocols have been used for use in an internet. One suite known as The TCP/IP internet protocol stands out most widely used for internets. Most networking professional simply refer this protocol as TCP/IP. Work on the transmission control protocol (TCP) began in the 1970s. The U .S military funded the research in TCP/IP and internetworking through the Advanc ed Research Projects Agency in short known as ARPA. Significance of internetwork ing and TCP/IP Internetworking has become one of the important technique in the modern networking. Internet technology has revolutionized the computer communica tion. The TCP/IP technology has made possible a global Internet, which reaches m illions of schools, commercial organizations, government and military etc around the world. The worldwide demand for internetworking products has affected most companies sell networking technologies. Competition has increased among the comp anies that sell the hardware and software needed for internetworking. Companies have extended the designs in two ways The protocols have adapted to work with ma ny network technologies And new features have been adapted that allow the protoc ols to transfer data across the internets C) Internet Layering Model Ans: Internet uses the TCP/IP reference model. This model is also called as Inte rnet layering model or internet reference model. This model consists of 5 layers as illustrated in figure below. The five layers of TCP/IP reference model A goal was of continuing the conversation between source and destination even if transmission went out of operation. The reference model was named after two of its main protocols, TCP (Transmission Control Protocol) and IP (Internet Protoco l). The purpose of each layer of TCP/IP is given below:

Layer 1: Physical layer This layer corresponds to basic network hardware Layer 2 : Network interface This layer specifies how to organize data into frames and ho w a computer transfers frames over a network. It interfaces the TCP/IP protocol stack to the physical network. Layer 3: Internet This layer specifies the format of packets sent across an internet. It also specifies the mechanism used to for ward packets from a computer through one or more routers to the final destinatio n. Layer 4: Transport This layer deals with opening and maintaining connections, ensuring that packets are in fact received. The transport layer is the interfac e between the application layer and the complex hardware of the network. It is d esigned to allow peer entities on the source and destination hosts to carry on c onversations. Layer 5: Network interface Each protocol of this layer specifies h ow one application uses an internet. 5. What is the use of IDENTIFIER and SEQUEN CE NUMBER fields of echo request and echo reply message? Explain. Ans: The echo request contains an optional data area. The echo reply contains th e copy of the data sent in the request message. The format for the echo request and echo reply is as shown in figure below echo request and echo reply message format The field OPTIONALDATA is a variable length that contains data to be returned to the original sender. An echo reply always returns exactly the same data as ws t o receive in the request. Field IDENTIFIER and SEQUENCE NUMBER are used by the s ender to match replies to

requests. The value of the TYPE field specifies whether it is echo request when equal to 8 or echo reply when equal to 0. Reports of Unreachability When a route r cannot forward or deliver the datagram to the destination owing to various pro blems, it sends a destination unreachable message back to the original sender an d then drops the datagram. Destination unreachable message format The format of destination unreachable is as shown in figure 5.3. The TYPE field in destination unreachable message contains an integer equal to 3. The CODE fiel d here contains an integer that describes the problem why the datagram is not re achable. Possible values for CODE field are listed in below figure. DE VALUE 0 1 2 3 4 5 6 7 8 9 10 11 12 Network unreachable Host unreachable Protocol unreacha ble Port unreachable Fragment needed and DF set Source route failed Destination network unknown Destination host unknown Source host isolated Communication with destination network administratively prohibited Communication with destination host administratively prohibited Network unreachable for type of service Host un reachable for type of service MEANING Possible problems in Destination unreachable message

Network unreachable errors imply routing failures and host unreachable errors im ply delivery failures. As ICMP error message contains a short prefix of the data gram that caused the problem, the source will know exactly which address is unre achable. The port is the destination point discussed at the transport layer. If the datagram contains the source route option with a wrong route, it may report source route failure message. If a router needs to fragment a datagram and DF-bi t which is dont fragment bit in IP header is set, the router sends a Fragment nee ded and DF set message back to the source. Rests of the errors listed in figure 5.4 are self explanatory. Obtaining a subnet mask To participate in subnet addre ssing, a host needs to know which bits of the 32-bit internet address correspond to physical network and which corresponds to host identifiers. The information needed to interpret the address is represented in 32-bit quantity is called subn et mask. To learn the subnet mask used for local network, a machine can send an address mask request message to a router and receive address mask reply message. Address mask request or reply message format Address mask request or reply message format The format address mask request or reply message is as shown in figure 5.10. Host broadcasts a request without know ing which specific router will respond. The TYPE field value is 17 for address m ask request and 18 for address mask reply message. A reply contains the networks subnet address mask in the ADDRESS MASK field. IDENTIFIER and SEQUENCE NUMBER f ields allow to associate replies with requests. 6. In what conditions is ARP pro tocol used? Explain. Ans: ARP protocol: In computer networking, the Address Resolution Protocol (ARP) is the standard method for finding a hosts hardware address when only its networ k layer address is known. ARP is primarily used to translate IP addresses to Eth ernet MAC addresses. It is also used for IP over other LAN technologies, such as Token Ring, FDDI, or IEEE 802.11, and for IP over ATM. ARP is used in four case s of two hosts communicating:

1. When two hosts are on the same network and one desires to send a packet to th e other 2. When two hosts are on different networks and must use a gateway/route r to reach the other host 3. When a router needs to forward a packet for one hos t through another router 4. When a router needs to forward a packet from one hos t to the destination host on the same network The first case is used when two ho sts are on the same physical network. That is, they can directly communicate wit hout going through a router. The last three cases are the most used over the Int ernet as two computers on the internet are typically separated by more than 3 ho ps. Imagine computer A sends a packet to computer D and there are two routers, B & C, between them. Case 2 covers A sending to B; case 3 covers B sending to C; and case 4 covers C sending to D. ARP is defined in RFC 826. It is a current Int ernet Standard, STD 37. ARP implementation We will see the implementation with t he help of an example. Consider an university with several class C (/24) network s. As illustrated in figure 3.1. here we have two Ethernets. One is in computer science (CS) department with IP address 192.31.65.0 and the one in electrical (E E) department with IP address 192.31.63.0. These are connected by the campus bac kbone FDDI ring with IP address 192.31.60.0. Each machine on an Ethernet has uni que physical addresses, labeled E1 through E6, and similarly each machine on FDD I ring has physical addresses, labeled F1 through F3. ARP protocol

Let us assume the sender on host 1 want to send a packet to a receiver on host 2 . Sender knows the name of the intended receiver say mary@eagle.cs.uni.edu. The first step is to find the IP address for host 2 known as eagle.cs.uni.edu. This mapping of name to IP address is done by domain name server (DNS). Here we will assume that DNS gives the IP address of host 2 as 192.31.65.5. The upper layer s oftware on host 1 builds a packet with 192.31.65.5 in the destination address fi eld and gives it to IP software to transmit. The IP software can look at the add ress see that the destination is on its own network, but needs a way to find the destinations physical address. A mapping table can be used as discussed in resol ution by direct mapping. A better solution is for host 1 to output a broadcast p acket onto the Ethernet asking WHO owns IP address 192.31.65.5? The broadcast wi ll arrive at every machine on Ethernet 192.31.65.0, and each one will check its IP address. Host 2 alone will respond with its physical address E2. The packet u sed for asking this question is called ARP request. And the packet which is repl y to this ARP request is called ARP replies. IP software on host 1 builds an Eth ernet frame addressed to E2, puts the IP packet addresses to 192.31.65.5 in the payload field and dumps it onto the Ethernet. The Ethernet board of host 2 detec ts this frame, recognizes it as frame for itself, scoops it up, and causes an in terrupt. The Ethernet driver extracts IP packet from the payload and passes it t o the IP software, which sees that it is correctly addressed and processes it. A RP frame format An ARP protocol uses two frame formats as seen in above example. One is ARP request and the other is ARP reply. ARP request An ARP request is st ructured in a particular way. As shown in figure 3.2 an ARP request frame consis ts of two fields 1. Frame header 2. ARP request message FrameHeader ARPrequestmessage MayIknowyourphysicalAddress? (a) ARP request frame Frame header is subdivided into 1. Physical address

2. IP address A complete ARP request frame is as shown in figure 3.2(b). We have seen that broadcast address consists of all 1s. hence the destinations physical address in ARP request frame is broadcast address with all ones equivalently FFFF-FF-FF-FF-FF. (b) ARP request frame ARP replies An ARP reply frame is also structured in a similar way as ARP reques t frame. As shown in figure (a) an ARP reply frame also consists of two fields 1 . Frame header 2. ARP reply message FrameHeader ARP reply Frame header is subdivided again into 1. Physical address 2. IP addres s FrameHeader ThisismyphysicalAddress (a) ARP reply frame A complete ARP request frame is as shown in figure (b). (b) ARP request frame ARP replies An ARP reply frame is also structured in a similar way as ARP reques t frame. As shown in figure (a) an ARP reply frame also consists of two fields

1. Frame header 2. ARP reply message FrameHeader ARPreplymessage ThisismyphysicalAddress (a) ARP reply frame ARP reply Frame header is subdivided again into 1. Physical address 2. IP addres s A complete ARP request frame is as shown in figure (b). (b) ARP reply frame The Address Resolution Cache Broadcasting the ARP request packet is too expensiv e to be used every time one machine wants to transmit a packet to another. As wi th this broadcasting every machine on the network must receive and then process the broadcast packet. To reduce the communication cost due to broadcast computer s that use ARP protocol maintain a cache of recently acquired IP to physical add ress bindings. Thus cache is used to store the recently used mappings of IP addr ess and physical address That whenever a computer sends an ARP request and recei ves an ARP reply, it saves the IP address and corresponding hardware address inf ormation in its cache for successive look ups. When transmitting a packet, a com puter always looks in its cache for binding before sending an ARP request. If it finds the desired binding in its ARP cache, the computer need not broadcast on the network. Thus when two computers on a network communicate, they begin with a n ARP request and response, and then repeatedly transfer packets without using A RP for each packet. ARP cache timeouts An ARP cache provides an example of soft state, a technique commonly used in network protocols. The name describes a situ ation in which information can become stale without warning. In case of ARP cons ider two computers A and B, both connected to Ethernet.

Assume A has sent an ARP request, and B has replied. Further assume that after t he exchange, computer B crashes. Computer A will not receive any information of the crash. And moreover as it already has binding information for B in its ARP c ache, computer A will continue to send packets to B. the Ethernet hardware provi des no indication that B is not online because Ethernet does not have guarantee delivery. Thus A has no way of knowing when information in its Arp cache has bec ome incorrect. Usually such protocols use timers, with the state information bei ng deleted when the timer expires. That is when a computer places the address bi ndings in cache it needs to set the timer. Typical value of timeout being say 20 minutes, and when the timer expires, that address binding information is delete d.

Вам также может понравиться