Computer Networks


Published on

1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Computer Networks

  1. 1. Computer Networks
  2. 2. Generic Types of Computer Networks <ul><li>Depending on the number of nodes and their proximity, three types of computer networks can be identified: </li></ul><ul><li>Local area network ( LAN ): It connects hundreds of computers, and the distance is up to a few kilometers . </li></ul><ul><li>Metropolitan area network ( MAN ): It connects thousands of computers in a metropolitan area within a distance of hundreds of kilometers. </li></ul><ul><li>Wide area network ( WAN ): It connects tens of thousands of computers distributed throughout a country or the world at a typical distance of thousands of kilometers . </li></ul>
  3. 3. Network Architecture (Layering) <ul><li>To reduce their design complexity, most networks are organized as a series of layers , i.e., network protocols are designed in terms of layered architecture ( layering ). </li></ul><ul><li>The major advantage of layering is that it clearly delineates the responsibilities of various protocols, by dividing responsibilities hierarchically among layers, with each layer offering services needed by the layer above. </li></ul><ul><li>The key to protocol families is that communication occurs logically at the same layer of the protocol in both sender and receiver, but it is implemented via services of the lower level (peer-to-peer) . </li></ul>7 6 5 4 3 2 1 1 2 3 4 5 6 7 Physical medium Layer 7 protocol Layer 6 protocol Layer 1 protocol
  4. 4. Layering Contd. <ul><li>The danger in layering is the considerable latency added to message delivery. However, protocol families are used to define a standard, not to force how the standard is implemented. </li></ul><ul><li>The most popular network architectures are OSI architecture and TCP/IP ( transmission control protocol/internet protocol ) architecture. </li></ul><ul><li>Application </li></ul><ul><li>Presentation Application </li></ul><ul><li>Session Transport </li></ul><ul><li>Transport Network </li></ul><ul><li>Network DataLink </li></ul><ul><li>Data Link Physical </li></ul><ul><li>Physical </li></ul><ul><li>OSI Layers TCP/IP Layers </li></ul>
  5. 6. OSI reference model <ul><li>7 Application Application 7 </li></ul><ul><li>6 Presentation Presentation 6 </li></ul><ul><li>5 Session Session 5 </li></ul><ul><li>4 Transport Transport 4 </li></ul><ul><li>3 Network 3 3 3 Network 3 </li></ul><ul><li>2 Data Link 2 2 2 Data Link 2 </li></ul><ul><li>1 Physical 1 1 1 Physical 1 </li></ul><ul><li>Host A Host B </li></ul><ul><li>The common purpose of layers 4-7 is to provide interoperability: all the system elements can exchange data regardless of the vendor of the equipment (open system). </li></ul><ul><li>Connectivity is provided in the layers 1-3 of the model, which provides a working connection between the sender and receiver, i.e., the ability to move data anywhere in the network, regardless of the transmission technology or medium. </li></ul>
  6. 7. OSI: Application layer <ul><li>This layer's responsibility is to interface the user application with the rest of the layers in the model. The Application layer is also responsible for providing an API ( Application Programming Interface ) to the user applications so the programmers who write code for the user interface don't have to worry about the implementation details of the interface. This means that the Application layer takes the responsibility of the networking details away from the user application so the user application does not have to know anything about the underlying implementation of the network. Some examples of user applications are file transfer services, printing services, e-mail services, network management consoles, client-server processes, and so on. </li></ul>
  7. 8. OSI: Presentation layer. <ul><li>This layer's responsibility is to provide encoding standards for the network. The Presentation layer is also responsible for negotiating between the Application layer and the rest of the protocol stack. It provides a standard encoding streamer for the Application layer so that communication between the Application layer and the rest of the protocol stack is standardized across different operating environments. In other words, the Presentation layer provides translation and conversion functions to successfully transfer data to the underlying protocol stack. As an example, if the Application layer of a PC sends information in ASCII format, the Presentation layer is responsible for formatting the information in the standard network type. This standard network type, which is generic for the underlying protocol stack across different operating environments, would be transferred without further conversion. At the receiving end, it is again the Presentation layer's responsibility to convert the generic network format to a format that the receiving application can understand. Data encryption and decryption can also take place at the Presentation layer. </li></ul>
  8. 9. OSI: Session layer. <ul><li>This layer's responsibility is to provide a communication channel between hosts. It provides a definition for managing the individual network channels, also called sessions , between two hosts. The Session layer is responsible for establishing a session between the hosts, as well as maintaining and ending the session. Some examples of the Session layer protocol are RPC ( Remote Procedure Call ), AppleTalk, and NFS ( Network File System ). </li></ul>
  9. 10. OSI: Transport layer. <ul><li>This layer's responsibility is to control the transmission of data on the network. In other words, it provides flow control mechanisms to ensure data integrity between the nodes. The flow control mechanism acknowledges the receipt of every segment from the sending host and the proper sequencing of the segments. If the sender does not receive an acknowledgement from the recipient, the flow control mechanism at the sender's end is responsible for resending the segment. On the whole, the Transport layer's responsibility is to segment the data received from the Session layer and forward it to the Network layer. In addition, the Transport layer receives segmented data from the Network layer to reassemble the segments to forward them to the Session layer. The Transport layer is also responsible for establishing a logical connection between the destination node and the source node. Some examples of the Transport layer are TCP and UDP ( User Datagram Protocol ). </li></ul>
  10. 11. OSI: Network layer. <ul><li>This layer's responsibility is to ensure the addressing of the hosts. It also ensures the routing of information between hosts across networks. In other words, the Network layer handles all of the transmission and traffic management among hosts. It also provides address resolution for the segments forwarded by the Data Link layer. </li></ul>
  11. 12. OSI: Data Link layer. <ul><li>This layer's responsibility is to define how data is accessed from a physical medium. It provides a mechanism to format the information presented from a physical medium so the information can be passed to the Network layer. The information presented from a physical medium can be in the form of bits. The Data Link layer collates this information and formats it into frames . A frame is a unit of information that contains the destination address, the source address, an error checksum, and the data itself. The Data Link layer is also responsible for converting the information obtained from the Network layer into bits to forward it to the Physical layer. In addition, the Data Link layer is responsible for ensuring that the messages traversing the network reach the appropriate physical devices. This is possible because the Data Link layer manages the unique identity of the physical device on the network. It uses the concept of hardware addressing (MAC address) to identify a physical device. Some examples of the Data Link layer protocol are ARP ( Address Resolution Protocol ) and RARP ( Reverse Address Resolution Protocol ). </li></ul>
  12. 13. OSI: Physical layer. <ul><li>This layer's responsibility is to manage the hardware details of sending and receiving binary data over a physical channel. The physical channel is typically made up of wires such as twisted-pair and fiber optic cables. It can also be made up of wireless media such as infrared or radio waves. In general, the Physical layer provides a specification for interfacing with a physical channel based on the electrical and mechanical functions of the medium. The connectors at the Physical layer have different topologies defined for different network designs. Topologies are the structures in which you set up your network. Some examples are the star topology, the ring topology, and the bus topology. One example of the Physical layer is the Ethernet standard, which is the network protocol that defines how different devices on the network communicate with each other over the Physical layer. </li></ul>
  13. 14. TCP/IP reference model <ul><li>5 layers </li></ul><ul><li>Application layer. This layer's responsibility is to provide a common interface for any user application to communicate with the underlying layers. In other words, the Application layer is responsible for providing an interface between the user application and the network. </li></ul><ul><li>Transport layer. This layer's responsibility is to control the flow of data between two communicating hosts. The Transport layer is responsible for breaking down data into packets and sending and receiving them from the Network layer. </li></ul><ul><li>Network layer. This layer's responsibility is to route packets across the network. It is also responsible for some message control and group management. </li></ul><ul><li>Link layer. This layer's responsibility is to handle the hardware-related details of the system. In other words, the Link layer is responsible for interfacing the operating system to the network interface card within the computer. </li></ul>Data Link Physical Network Layer Transport Layer Application Layer
  14. 15. TCP/IP enabled communica
  15. 16. Internetwork communication
  16. 17. Homework <ul><li>Compare OSI and TCP/IP model </li></ul>
  17. 18. LAN Components <ul><li>3 general characteristics: </li></ul><ul><ul><li>A diameter of not more than a few kilometers. </li></ul></ul><ul><ul><li>A total data rate of at least several Mbps. </li></ul></ul><ul><ul><li>Completely ownership by a single organization. </li></ul></ul><ul><li>The medium in LAN is usually a twisted pairs of copper wires, or coaxial cable , or fiber optics . It may also be wireless transmission . </li></ul><ul><li>Hardware in LAN includes network interface cards (NICs), servers , communication devices . </li></ul><ul><li>NIC connects a machine to LAN. </li></ul><ul><li>Server provides service to other machines. </li></ul><ul><li>Communication devices include repeaters, bridges, routers , and gateways etc.. </li></ul>
  18. 19. LAN components <ul><li>Repeaters copy individual bits between cable segments. </li></ul><ul><li>Bridges connect LANs together. </li></ul><ul><li>Routers or gateways connect LANs to WANs or WANs to WANs and resolve incompatible addressing. </li></ul>LAN server Repeater Host To WAN router Router Other LAN Bridge
  19. 20. LAN Communication Concepts <ul><li>In LAN, network control is distributed among the devices on the network, it resides in the NIC firmware in each machine. </li></ul><ul><li>LAN communication may be connectionless or connection-oriented . </li></ul><ul><li>Connectionless messages ( datagrams ) are sent with the expectation that they will be received correctly. There is no acknowledgment of correct receipt. A higher layer must ask for retransmission if the message is received incorrectly. </li></ul><ul><li>Connection-oriented communications include the acknowledgment of message as correct before they are passed on to the recipient. </li></ul>
  20. 21. Comm. Concepts contd. <ul><li>LANs have five major communications characteristics: </li></ul><ul><li>Medium : the means by which data is sent. </li></ul><ul><li>Transmission technique : In baseband technique, the LAN signal is carried directly on the medium; in broadband system, the LAN signal is modulated on to an analog carrier signal, which allows several LANs to share the same medium. </li></ul><ul><li>Network topology : the layout of the cabling. </li></ul><ul><li>Access control method : contention (Ethernet) and token passing ( token ring ) for shared medium. </li></ul><ul><li>Data Rate : the raw ability to transfer information in mega bits per second. </li></ul>
  21. 22. Comm. Concepts contd. <ul><li>In LANs, the machines can be connected by shared medium or switched ( point-to-point ) medium. </li></ul><ul><li>Shared medium : Multiple computers share a single interconnection medium (Ethernet). </li></ul><ul><li>Switched medium : It allows communication directly from source to destination, without intermediate nodes to interfere with these signals. </li></ul>
  22. 23. WAN <ul><li>Wide area networks (WANs) carry message at a lower speed between computers that are separated by large distance. </li></ul><ul><li>Many WANs and LANs can be combined to produce a single internetwork – a communication system that interconnects large collections of geographically dispersed computers. </li></ul><ul><li>The computers interconnected by a WAN are called host computers . The communication medium is a set of communication circuits linking a set of dedicated computers called packet switches or packet switching exchanges (PSEs). </li></ul><ul><li>The OSI layer architecture, TCP/IP layer architecture, or other layer architectures can be used in building WANs. </li></ul>
  23. 24. WAN <ul><li>In WANs (packet networks), a message is divided into packets before transmission and the packets are reassembled at the receiving computer (transport layer). A packet consists of a header and a data field. The header contains a transport address composed of the network address of a host and a port number. </li></ul><ul><li>The PSEs operate the network by forwarding packets from one PSE to another along a route from sender to the recipient. PSEs are responsible for defining the route (network layer). </li></ul>
  24. 25. WAN <ul><li>Every packet of data is stored temporarily by each PSE along its route before it is forwarded to another PSE ( store-and-forward communication). The routing operations introduce a delay at each point in the route, and the total transmission time for a message depends on the route it follows. </li></ul><ul><li>Two types of data transport service can be provided: connection-oriented -- a `virtual connection is set up between a sending and a receiving process and is used for the transmission of a stream of data; connectionless – individual messages (datagrams) are transmitted to specified destinations. </li></ul>
  25. 26. Intranet LAN LAN SW1 LAN LAN SW2 SW3 A D DATA T2 10 87 10 12 15 19 87
  26. 27. LAN LAN WAN S1 F1 F2 F3 LAN LAN F1 F2 F2 F1 S2 S3 A D D A S1 S3 Internet
  27. 28. Introduction to DLL <ul><li>Receives service from physical layer and provides service to the network layer. </li></ul><ul><li>Receives service from network layer and provides service to physical layer. </li></ul><ul><li>Responsible for carrying data from one hop to the next hop. </li></ul>DATA T2 10 87 10 12 15 19 87
  28. 29. Duties packetinzing Addressing Error control Flow control Access control Duties of DLL Frame or cell MAC or VC CRC Prevent conflict or collision DLL is for point to point, or node to node on a common link LAN and WAN operate in DLL 12 15 19 87 bridge
  29. 30. IEEE standards <ul><li>802 project </li></ul><ul><ul><li>LLC (logical Link Control) </li></ul></ul><ul><ul><li>MAC (Media Access Control) </li></ul></ul><ul><li>802.3:CSMA/CD </li></ul><ul><li>802.4: TOKEN BUS </li></ul><ul><li>802.5: TOKEN RING </li></ul><ul><li>802.6: DQDB </li></ul><ul><li>802.11: WIRELESS LAN </li></ul>MAC LLC PHYSICAL LAYER PHYSICAL LAYER DLL IEEE INTERNET
  30. 31. Design issues <ul><li>How to perform the duties stated in the last slide? </li></ul><ul><li>DL can be designed to offer various services. 3 main responsibilities: </li></ul><ul><ul><li>Unacknowledged Connectionless service. </li></ul></ul><ul><ul><li>Acknowledged connectionless service. </li></ul></ul><ul><ul><li>Connection oriented service. </li></ul></ul>
  31. 32. Connection oriented service <ul><li>A connection is established before the data is sent. Each frame sent is numbered, and DL guarantees that the frame is indeed received. Each frame is received only once and in right order. </li></ul><ul><li>Transfers have 3 distinct phases. </li></ul><ul><ul><li>Connection establishes by initializing variables and counters needed to keep track of frames received. </li></ul></ul><ul><ul><li>One or more frames are transmitted </li></ul></ul><ul><ul><li>Connection released by freeing variables, buffers and other resources to maintain the connection. </li></ul></ul>
  32. 33. Framing <ul><li>Packetizing. Hand over the frame to physical layer. Or create frames from raw data received from physical layer. </li></ul><ul><li>Breaks up bit streams into discrete frames and compute checksums for each frame. </li></ul><ul><ul><li>Frame gap; in addition to this </li></ul></ul><ul><ul><ul><li>Character count; rarely used now </li></ul></ul></ul><ul><ul><ul><li>Starting and ending character with character stuffing </li></ul></ul></ul><ul><ul><ul><li>Start, end flags with bit stuffing </li></ul></ul></ul><ul><ul><ul><li>Physical layer coding violation </li></ul></ul></ul>
  33. 34. <ul><li>Problem with character count </li></ul><ul><ul><li>count character may be corrupted. </li></ul></ul><ul><li>Character delimiter </li></ul><ul><ul><li>ASCII character sequence used as frame delimiter </li></ul></ul><ul><ul><li>When delimiter appears in the data consecutive delimiter character is used as a escape sequence. </li></ul></ul><ul><li>Suitable for 8-bit character and ASCII code transfer. </li></ul>
  34. 35. <ul><li>Start, end flags with bit stuffing </li></ul><ul><ul><li>Start bit pattern: 01111110 </li></ul></ul><ul><ul><li>If there are consecutive 5 1s on the data, DLL automatically stuff a 0 bit after the consecutive 5 1s in the outgoing bit pattern. Receiver remove this 0 bit after the consecutive 5 1s. </li></ul></ul><ul><li>Use different encoding for data and frame separator. </li></ul><ul><ul><li>Manchester encoding represent 1 by H-L and 0 by L-H. H-H and L-L are not used for data. One can use H-H-L-L as frame delimiter. </li></ul></ul>
  35. 36. Error control <ul><li>Need feedback for sending frames. </li></ul><ul><li>Waiting time for feedback: timer. </li></ul><ul><li>Retransmit is frame or the acknow is lost. </li></ul><ul><li>Potential danger to retransmitting. </li></ul><ul><li>Use sequence number to each outgoing frame. </li></ul><ul><li>Whole issue is of managing timers and sequence numbers so as to ensure that each frame is ultimately passes to the NL at the destination exactly once. </li></ul>
  36. 37. Flow control <ul><li>How does a recv handle the situation when a sender sends frames faster than it can receive. </li></ul><ul><li>Sender need feedback from recv to control its frame rate. </li></ul>
  37. 38. Access control <ul><li>Link management </li></ul>
  38. 39. Elementary data link protocols: Flow control protocols
  39. 40. <ul><li>Physical, data link and Network layers are independent. Uses message to communi. </li></ul><ul><li>Connection oriented, reliable channel. </li></ul><ul><li>Infinite supply of data. </li></ul><ul><li>No processing delay. </li></ul><ul><li>Simplex mode. </li></ul><ul><li>DL waits for a packet form NL. When and if DL recv a pack from NL, it encapsulates it into a frame adding some control bits (header), and then handed over to physical layer. Transmitting HW appends checksum bits and then transmits frame on the cable. </li></ul><ul><li>DL in rcvr waits for a frame from physical layer. DL may wait in an infinite loop or for an interrupt from physical layer. Recv HW recv a frame and computes the checksum. If checksum is ok frame is recvd undamaged and passed to DL. DL checks if the destination matches with its own id. If everything is ok, DL drops the frame header and passed the packet to NL. </li></ul>
  40. 41. Definitions <ul><li>const LastBit = ….; {determines the pkt size} </li></ul><ul><li>doomsday = false; {repeat forever} </li></ul><ul><li>MaxSeq = ….; {Highest Seq = 2 n -1} </li></ul><ul><li>type bit = 0..1; </li></ul><ul><li>SequenceNr = 0 .. MaxSeq; </li></ul><ul><li>packet = packed array [0 .. LastBit] of bit; </li></ul><ul><li>FrameKind = (data, ack, nak); </li></ul><ul><li> Frame = packed record </li></ul><ul><li>kind: FrameKind; </li></ul><ul><li>seq: SequenceNr; </li></ul><ul><li>ack: SequenceNr; </li></ul><ul><li>info: packet; </li></ul><ul><li>end ; </li></ul>
  41. 42. <ul><li>procedure wait ( var event: EvType); </li></ul><ul><li>begin {wait for an event to happen; return its type in event } end. </li></ul><ul><li>procedure FromNL( var p: packet); </li></ul><ul><li>begin {Fetch info from NL for transmission} end ; </li></ul><ul><li>procedure ToNL(p: packet); </li></ul><ul><li>begin {delivers info from inbound frame to NL} end ; </li></ul><ul><li>procedure FromPhysL(var r: frame); </li></ul><ul><li>begin { get an frame from PhysL and copy it to r } end; </li></ul><ul><li>procedure ToPhysL(s: frame); </li></ul><ul><li>begin { pass the frame s to PhysL for transmission} end ; </li></ul><ul><li>procedure StartTimer(k: SequencNr); </li></ul><ul><li>begin {start the clock and enable TimeOut event} end ; </li></ul>Definitions contd.
  42. 43. <ul><li>procedure StopTimer(k:SequenceNr); </li></ul><ul><li>begin {Stop the clock and disable TimeOut event} end ; </li></ul><ul><li>procedure StartAckTimer; </li></ul><ul><li>begin {Start aux timer for sending separate acks} end ; </li></ul><ul><li>procedure StopAcktimer ; </li></ul><ul><li>begin {Stop aux timer and disable NLIdle event} end; </li></ul><ul><li>procedure EnableNL ; </li></ul><ul><li>begin {allows NL to cause a NLReady event} end; </li></ul><ul><li>procedure DisableNL ; </li></ul><ul><li>begin {Forbids NL from causing a NLReady event} end; </li></ul><ul><li>procedure inc ( var k : SequenceNr ); </li></ul><ul><li>begin {increment k circularly} end; </li></ul>Definitions contd.
  43. 44. Unrestricted simplex protocol <ul><li>Assumptions: Data trans in one direction only. Channel error free. No processing delay. Infinite buffer space. </li></ul><ul><li>Sender DL protocol: </li></ul><ul><li>type EvType = ( FrameArival ); </li></ul><ul><li>procedure sender1; </li></ul><ul><li>var s: frame; </li></ul><ul><li>buffer: packet; </li></ul><ul><li>begin </li></ul><ul><li>repeat </li></ul><ul><li>FromNL (buffer); </li></ul><ul><li> = buffer; </li></ul><ul><li>ToPhysL(s); </li></ul><ul><li>until doomsday </li></ul><ul><li>end; </li></ul>
  44. 45. <ul><li>Receiver end DL: </li></ul><ul><li>procedure receiver1; </li></ul><ul><li>Var r : frame; </li></ul><ul><li>event : EvType; </li></ul><ul><li>begin </li></ul><ul><li>repeat </li></ul><ul><li> wait(event); </li></ul><ul><li> FromPhysL(r); </li></ul><ul><li> ToNL(; </li></ul><ul><li>until doomsday; </li></ul><ul><li>end; </li></ul>
  45. 46. Simplex wait-and-Stop protocol <ul><li>The main problem we have to deal with is how to prevent sender from flooding the recevr with data faster than it can handle. </li></ul><ul><li>Assumption: recev has limited buffer, needs time to process frames. Needs mechanism to control the rate of frame-flow from sender. </li></ul><ul><li>If the recvr requires a time t to execute FromPhysL+ToNL , the sender must transmit at an average rate less than one frame per t time. Moreover, recvr HW my not have automatic buffer and queuing. </li></ul><ul><li>Recvr sends a dummy frame as the feedback => Ack. </li></ul><ul><li>Sender wait for Ackn before it sending the next frame. </li></ul><ul><li>A half-duplex physical channel is sufficient here. </li></ul>
  46. 47. <ul><li>type Evtype = (FrameArrival); </li></ul><ul><li>procedure sender2; </li></ul><ul><li>var s:frame; </li></ul><ul><li> buffer: packet; </li></ul><ul><li> event: EvType; </li></ul><ul><li>begin </li></ul><ul><li>repeat </li></ul><ul><li>FromNL(buffer); </li></ul><ul><li> = buffer; </li></ul><ul><li>ToPhysL(s); </li></ul><ul><li>wait(event); </li></ul><ul><li>until doomsday </li></ul><ul><li>end; </li></ul>procedure receiver2 ; var s,r: frame ; event: EvType ; begin repeat wait(event); FromPhysL(r); ToNL(; ToPhysL(s); until doomsday; end;
  47. 48. Stop and Wait protocol for Noise channel <ul><li>Sending device keeps a copy of the last frame transmitted until it recvs an ack for that frame. </li></ul><ul><li>Both data frames and ack frames are numbered alternatively o and 1. A data 0 frame is ack by an ACK 1 frame, indicating that it has recved data frame 0 and expecting data frame 1. </li></ul><ul><li>If the recvr detects an error in the recevd frame, it simply discard the frame and send no ack. If the recvr recives a frame out of order, it knows that a frame is lost. It discards the out-of –order recvd frame. </li></ul><ul><li>Sender has control variable S, that holds the number iof the recently sent frame (0 or 1). The rcvr has a control variable, R, that holds the number of the next frame expected (0 or 1). </li></ul><ul><li>The sender starts a timer when it sends a frame. If an ack is not received within timeout period, the sender assumes that the frame is lost and resends it. </li></ul><ul><li>Rcvr sends only positive ack for frames received safely. Ack number always defines the next frame expected. </li></ul>
  48. 49. Operation: Normal S=0 S=1 R=0 R=1 Ack 1 Ack 0 time
  49. 50. Lost frame <ul><li>A receiver remains silent and keeps it value of R. </li></ul><ul><li>After the time out interval at the sender ends, sender sends another copy of the frame. </li></ul>
  50. 51. Lost Acknowledgement <ul><li>If the sender receives a damaged Ack, it discards it. </li></ul><ul><li>When the timeout for Ack is over sender retransmits the frame. </li></ul><ul><li>However, receiver discards the duplicate frame and sends the Ack again. </li></ul>
  51. 52. Delayed Ack <ul><li>Ack is received by the sender after the timeout for ack 0. The sender already retransmitted a copy of the frame 0. </li></ul><ul><li>Since receiver expects the frame 1, it simply discards the duplicate frame 0 and sends ack 1. </li></ul>
  52. 53. Piggybacking <ul><li>Bidirectional transmission. </li></ul><ul><li>Piggybacking combines data frame with acknowledgment </li></ul>
  53. 54. Sliding window protocols <ul><li>To improve efficiency multiple frames ( outstanding frame) are sent: </li></ul><ul><ul><li>Go back N </li></ul></ul><ul><ul><li>Selective repeat </li></ul></ul><ul><li>Frames are numbered sequentially from 0 to 2 N -1. If N is 3, frames are: 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,….. </li></ul><ul><li>Sliding window concept is used to hold the outstanding frame. </li></ul>Senders sliding window
  54. 55. Receivers 1 bit sliding window <ul><li>Always 1 bit window. </li></ul><ul><li>Hold outstanding frame; the frame to be received next. </li></ul>
  55. 56. Control variables <ul><li>S – of recently sent frame. </li></ul><ul><li>S F – seq. no of the first frame in the window. </li></ul><ul><li>S L – Last frame in the window. </li></ul><ul><li>R – seq no of the frame it expects to receive. </li></ul>
  56. 57. Acknowledgement <ul><li>If a frame is damaged or is received out of order, the recv is silent and will discard all subsequent frames. </li></ul><ul><li>The silence of the recev. Cause the timer of the unack frame in the sender to expire. Then sender go back to send all frames, beginning with the one unack one. </li></ul>
  57. 58. Go back N normal operation
  58. 59. Lost or damaged frame
  59. 60. Sender window size <ul><li>Window size must be less than 2 m . </li></ul><ul><li>Otherwise recv can recv erroneous packet. </li></ul><ul><li>Piggybacking is possible to implement bidirectional transmission. </li></ul><ul><li>Q: Explain the problem that can result in if the window size is larger than or equal to 2 m . </li></ul>
  60. 61. Selective repeat <ul><li>Sender and receiver window size must be less than or equal to 2 m /2 </li></ul>3| 0| 1| 2| 3|
  61. 62. HDLC NRM ABM Normal Response mode Asynchronous balanced mode HDLC: High level data link control
  62. 63. HDLC <ul><li>Bit oriented. Use bit stuffing. </li></ul><ul><li>Control </li></ul><ul><ul><li>Sequence no., ackn., etc </li></ul></ul><ul><li>Data </li></ul><ul><ul><li>Information. Arbitrarily long with reduced checksum efficiency. </li></ul></ul><ul><li>Checksum </li></ul><ul><ul><li>Error control </li></ul></ul><ul><li>On idle flags sequences are transmitted continuously </li></ul><ul><li>Minimum frame length three fields (32 bits)+flag bits </li></ul>
  63. 64. <ul><li>Three kinds of frames: Information, Supervisory, Unnumbered. </li></ul><ul><li>Seq – frame sequence no. 3 bit sliding window. Next – piggybacked ackn. P/F – poll/final, P is used when computer is inviting the terminal to send data. All the frames sent by the terminal set the bit to P , except the final one, which is set to F . </li></ul>Information Supervisiony Unnumbered Control fields for three kinds of frames
  64. 65. <ul><li>In some of the protocols the P/F bit is used to force the other machine to send a supervisory frame immediately rather than waiting for the reverse traffic onto which to piggyback the window information. </li></ul><ul><li>Type – for different kinds of supervisory frames. Type 0 is RECEIVE READY, 1 is REJECT. Next field indicates frames to be retransmitted, Type 2 – receive not ready, Type 3 - selective reject. </li></ul><ul><li>Unnumbered Frames – used for connectionless services. Differs greatly on implementation. </li></ul>