JEPPIAAR ENGINEERING COLLEGEDEPARTMENT OF INFORMATION TECHNOLOGY CS6551- COMPUTER NETWORKS NOTES CS6551 COMPUTER NETWORKS UNIT I FUNDAMENTALS & LINK LAYER 9 Building a network – Requirements - Layering and protocols - Internet Architecture – Network software – Performance ; Link layer Services - Framing - Error Detection - Flow control UNIT II MEDIA ACCESS & INTERNETWORKING 9 Media access control - Ethernet (802.3) - Wireless LANs – 802.11 – Bluetooth - Switching and bridging – Basic Internetworking (IP, CIDR, ARP, DHCP, ICMP) UNIT III ROUTING 9 Routing (RIP, OSPF, metrics) – Switch basics – Global Internet (Areas, BGP, IPv6), Multicast – addresses – multicast routing (DVMRP, PIM) UNIT IV TRANSPORT LAYER 9 Overview of Transport layer - UDP - Reliable byte stream (TCP) - Connection management Flow control - Retransmission – TCP Congestion control - Congestion avoidance (DECbit, RED) – QoS – Application requirements UNIT V APPLICATION LAYER 9 Traditional applications -Electronic Mail (SMTP, POP3, IMAP, MIME) – HTTP – Web Services – DNS - SNMP TEXT BOOK: 1. Lary L. Peterson, Bruce S. Davie, ―Computer Networks: A Systems Aproach‖, Fifth Editon,Morgan Kaufman Publishers, 201.4 REFERENCES: 1. James F. Kurose, Keith W. Ross, ―Computer Networking - A Top-Down Approach Featuring the Internet‖, Fifth Edition, Pearson Education, 2009. 2. Nader. F. Mir, ―Computer and Communication Networks‖, Pearson Prentice Hall Publishers, 2010. 3. Ying-Dar Lin, Ren-Hung Hwang, Fred Baker, ―Computer Networks: An Open Source Approach‖, Mc Graw Hill Publisher, 2011. 4. Behrouz A. Forouzan, ―Data communication and Networking‖, Fourth Edition, Tata McGraw – Hill, 2011. 1|Page CS6551 COMPUTER NETWORKS Sl. Topics No. No of Book Hours No. UNIT-I : FUNDAMENTALS & LINK LAYER 1 Building a network 1 T(Pg 1-6) 2 Requirements 1 T(Pg 6- 24) 3 Layering and protocols 1 4 5 Internet Architecture Network software 1 1 T(Pg 33-36) 6 Performance 1 T(Pg 44-55) 7 Link layer Services - Framing 2 T(Pg 81-91) 8 Error Detection 2 9 Flow control 1 T(Pg 24-33), T(Pg 36-44) T(Pg 91-102), T(Pg 102-119) UNIT – II : MEDIA ACCESS & INTERNETWORKING 10 Media access control 1 T(Pg534-539) , 11 Ethernet (802.3) 1 T(Pg 119-128) 12 Wireless LANs – 802.11 1 T(Pg 128-142), 13 Bluetooth 1 T(Pg 142-144), 14 Switching and bridging 2 T(Pg 170-203) 15 Basic Internetworking - IP 2 16 CIDR, ARP 1 17 DHCP, ICMP 1 T(Pg 203-224), T(Pg 225-231), T(Pg 231-235), UNIT – III : ROUTING Sl. No. Topics No of Book Hours No. T(Pg 240-252), 2|Page CS6551 COMPUTER NETWORKS UNIT-IV : TRANSPORT LAYER 25 Overview of Transport layer. 28 Flow control 1 T(Pg 407-414) 29 Retransmission 1 T(Pg 414-422) 30 TCP Congestion control 2 T(Pg 499-514). POP3. UDP 1 T(Pg 391-396).RIP 1 T(Pg 183-187). 27 Connection management 1 T(Pg 402-407). T(Pg 308-338). T(Pg 514-530). IPv6) 2 23 Multicast . Application requirements 1 T(Pg 530-558) T(Pg 698-700) T(Pg 700-708). T(Pg 756-758) CS6551 COMPUTER NETWORKS . UNIT-V : APPLICATION LAYER 33 Traditional applications 1 34 Electronic Mail (SMTP. PIM) 2 T(Pg 341-354) T(Pg 252-262).18 Routing .Metrics 1 T(Pg 262-266) 21 Switch basics 1 T(Pg 267-270) 22 Global Internet (Areas. 31 Congestion avoidance (DECbit. 26 Reliable byte stream (TCP) 1 T(Pg 396-402). 19 Routing .OSPF 1 20 Routing .addresses 1 T(Pg 338-341) 24 Multicast routing (DVMRP. IMAP. RED) 1 32 QoS. MIME) 2 35 HTTP 1 T(Pg 708-718). 36 Web Services 2 T(Pg 718-727) 37 DNS 2 38 SNMP 1 3|Page T(Pg 745-755). BGP. Telephone System Packet switched – e. or video) and they typically connect to special-purpose devices (terminals. When more than two nodes share a single physical link then it is referred as Multiple access. COMPUTER NETWORKS DEFINTION: A computer network is defined as the interconnection of two or more computers. video-on-demand. Physical Medium – Link Computers -Nodes When a physical link occurs between a pair of nodes then it is referred as point-to-point. The systematic way of organizing these forwarding nodes form a switched network.Framing . Postal System 4|Page CS6551 COMPUTER NETWORKS . Connectivity Connectivity occurs between two computers through physical medium like coaxial cable or an optical fiber. Link layer Services . Sharing of information over geographically wide areas. and digital libraries. hand receivers. It is done to enable the computers to communicate and share available resources. Sharing of expensive software's and database iii. To some. voice. Communication from one computer to another computer iv. the only interesting network is the cable network used to disseminate video signals. APPLICATIONS: i. distributed computing. The main thing these networks have in common is that they are specialized to handle one particular kind of data (keystrokes.Layering and protocols . and television sets).UNIT I FUNDAMENTALS & LINK LAYER Building a network – Requirements . that has the potential to grow to global proportions and to support applications as diverse as teleconferencing. To others. What is network? Network meant the set of serial lines used to attach dumb terminals to mainframe computers.g.Internet Architecture – Network software – Performance . Data communication between the nodes is done by forwarding the data from one link to another.Error Detection .Flow control BUILDING A NETWORK To build a computer network. Exchange of data and information among users via network v. electronic commerce.g. (a) point-to-point (b) Multiple-access. the term implies the voice telephone network. Sharing of resources such as printers ii. Two common types of switched network are Circuit switched – e. two devices may be connected but not communicating. workstation. Store and forward strategy: This network follows this technique. Direction of data Flow: Simplex unidirectional. 3. etc. Transmission Medium .It is a set of rules that governs the data communications. Some examples include twisted-pair wire. telephone handset etc. pictures. These blocks can be called as packet or message.Packet Switched Network In this network nodes send discrete blocks of data to each other. stores in internal memory and then forwards to next node‖. Protocol . It can be a computer. 2. image is converted to pixels. 5. It represents an agreement between the communicating devices.It is the physical path by which a message travels from sender to receiver. Cloud represents the network Nodes inside the cloud (Switches) – Implement the network Nodes outside the cloud (host) Use the network COMPONENTS OF COMPUTER NETWORK Two or more computers Cables as links between the computers A network interfacing card(NIC) on each computer Switches Software called operating system(OS) Five components of data communication The five components are : 1. one transmits. It can be a computer. Message . 4. Text is converted to binary.It is the information to be communicated.It is the device which sends the data messages. Receiver . Without a protocol. Circuit Switched Network It first establishes a circuit across the links and allows source node to send stream of bits across this circuit to the destination node The representation of network is given by cloud symbol Fig: Switched network. video etc. audio. Popular forms of information include text. coaxial cable.It is the device which receives the data messages. number doesnt converted. workstation. Sender . other receives 5|Page CS6551 COMPUTER NETWORKS . radio waves etc. telephone handset etc. It means ―Each node receives a complete packets over the link. communication must alternate Full-duplex – both can transmit/receive simultaneously Topology Physical or logical arrangement Topology of a network is the geometric representation of the relationship of all the links and linking devices to one another 5 basic types: mesh. star.Half-duplex – each can transmit/receive. ring.Tree May often see hybrid Categories of topology Mesh Topology Dedicated point-to-point links to every other device n(n-1)/2 links an each device will have n-1 I/O ports Advantages Dedicated links – no traffic problems Robust Privacy/Security Easy fault identification and isolation Disadvantages more amount of cabling and I/O ports requirement Installation and reconnection is difficult Expensive 6|Page CS6551 COMPUTER NETWORKS . bus. a fault/break in the bus cable stops all transmission Ring Topology Dedicated point-to-point configuration to neighbors Signal is passed from device to device until it reaches destination Each device functions as a repeater Advantages : easy to install and reconfigure Disadvantages :limited ring length and no: of devices. break in a ring can disable entire network TREE TOPOLOGY 7|Page CS6551 COMPUTER NETWORKS . less cabling Disadvantages : Difficult reconnection and fault isolation.Star Topology Dedicated point-to-point links to central controller (hub) Controller acts as exchange Advantages less expensive robustness Disadvantages More cabling requirement than ring and bus topologies If central hub fails the whole network fails to operate Bus Topology Multipoint configuration One cable acts as a backbone to link all devices Advantages : Ease of installation. Advantages of Tree Topology 1. It may be a single network or connecting a number of LANs into a large network. 2. Today the speed is on increasing and can reach 100 mbps. 3. 3. It is also called hierarchical topology. building and campus. The most common LAN topologies are bus. Metropolitan area network. telephone companies provide a popular MAN service called switched multi megabit data service (SMDS). Disadvantages of Tree Topology 1. 4. They have data rates from 4 to 16 Mbps. Error detection is easily done. Currently LAN size is limited to a few kilometers. and physical architecture Local Area Network (LAN) – smaller geographical area Metropolitan Area Network (MAN) – network extended over an entire city Wide Area Network (WAN) – large geographical area CATEGORIES OF NETWORKS: There are three primary categories are. Categories Of Networks Based on size. distance covered.It has a root node and all other nodes are connected to it forming a hierarchy. Central hub fails. Wide area network. Heavily cabled. Wide Area Network: 8|Page CS6551 COMPUTER NETWORKS . If more nodes are added maintenance is difficult. Local area network. Extension of bus and star topologies. It should at least have three levels to the hierarchy. 1. So the resources are shared between LANs. Example of MAN is. Ideal if workstations are located in groups. It may be from two PC‘s to throughout a company. 2. Local Area Network: They are usually privately owned and link the devices in a single office. network fails. Costly. Metropolitan Area Network: They are designed to extend over an entire city. Easily managed and maintained. 2. 4. 3. ring and star. Expansion of nodes is possible and easy. Used in Wide Area Network. ownership. 2. Features of Tree Topology 1. 1. 3. 2. if the two wires are parallel. Twisting makes it probable that both wires are equally affected by external influences. Coaxial Cable and Fiber-optic cable. Twisted Pair Cable A twisted pair consists of two conductors (normally copper) each with its own plastic insulation. voice. A signal traveling along any of these media is directed and contained by the physical limits of the medium. PHYSICAL LINKS Guided Media Guided media conduct signals from one device to another include Twisted-pair cable. a balance is maintained. Twisted-pair and coaxial cable use metallic (copper) conductors that accept and transport signals in the form of electric current. The following figure shows the difference between UTP and STP Applications 9|Page CS6551 COMPUTER NETWORKS . It is more expensive. continent or even the whole world. image and video information over a large geographical are like country. Metal casing improves that quality of cable by preventing the penetration of noise or cross talk. Twisted Pair Cable comes into two forms: Unshielded Shielded Unshielded versus shielded Twisted-Pair Cable Shielded Twisted-Pair (STP) Cable has a metal foil or braided-mesh covering that encases each pair of insulated conductors. By twisting the pair. Optical fiber is a glass cable that accepts and transports signals in the form of light.It provides a long distance transmission of data. Suppose in one twist one wire is closer to noise and the other is farther in the next twist the reverse is true. One of the wires is used to carry signals to the receiver Other is used as ground reference Interference and cross talk may affect both the wires and create unwanted signals. twisted together. Local area networks also use twisted pair cables. Instead of having two wires. Properties of light Light travels in a straight line as long as it moves through a single uniform substance. 10 | P a g e CS6551 COMPUTER NETWORKS . If traveling through one substance suddenly enters another. The outer metallic wrapping serves both as a shield against noise and as the second conductor and the whole cable is protected by a plastic cover. and with outer conductor of metal foil. Categories of coaxial cables Category Impedance Use RG-59 75 Cable TV RG-58 50 Thin Ethernet RG-11 50 Thick Ethernet Applications It is used in analog and digital telephone networks It is also used in Cable TV networks It is used in Ethernet LAN Connectors BNC connector – to connect the end of the cable to a device BNC T . Connectors The most common UTP connector is RJ45. Coaxial Cable Coaxial cable (coax) carries signals of higher frequency ranges than twisted pair cable. If the angle of incidence is equal to the critical angle.at the end of the cable to prevent the reflection of the signal. the light bends along the interface. Bending of light ray If the angle of incidence(the angle the ray makes with the line perpendicular to the interface between the two medium) is less than the critical angle the ray refracts and move closer to the surface.to branch out network connection to computer BNC terminator . ray changes its direction. coax has a central core conductor of solid or stranded wire (usually copper) enclosed in an insulating sheath. Fiber Optic Cable A fiber-optic cable is made of glass or plastic and transmits signals in the form of light. Twisted Pair cables are used in telephone lines to provide voice and data channels. If the angle of incidence is greater than the critical angle. A ray of light moves through this constant density in a straight line until it reaches the interface of the core and the cladding. Critical angle differs from one medium to another medium.Index Multimode In the multiple mode. Multimode-Step-Index fiber: The density of core remains constant from the centre to the edge. the ray reflects and travels again in the denser substance. A Glass or plastic core is surrounded by a cladding of less dense glass or plastic. At the interface there is an abrupt change to a lower density that changes the angle of the beam‘s motion. Multimode. Optical fiber use reflection to guide light through a channel. Single Mode 11 | P a g e CS6551 COMPUTER NETWORKS . Propagation Modes Mode Multimode Step-Index Single mode Graded .Graded -Index fiber: The density is varying. Density is highest at the centre of the core and decreases gradually to its lowest at the edge. multiple light beams from a source move through the core in different paths. This type of communication is often referred to as wireless communication. Straight-tip (ST) connector is used for connecting cable to networking devices. Connectors Subscriber channel (SC) connector is used for cable TV. can penetrate walls. Sky propagation – High frequency waves radiate upward into ionosphere and reflected back to earth. particularly those of low and medium frequencies. all close to the horizontal.The single mode fiber itself is manufactured with a much smaller diameter than that of multimedia fiber. Properties Radio waves are omnidirectional. A sending antenna sends waves that can be received by any receiving antenna. This means that the sending and receiving antennas do not have to be aligned. Line-of-sight propagation – Very high frequency signals travel in a straight line Radio Waves Electromagnetic waves ranging in frequencies between 3 kHz and 1 GHz are normally called radio waves. Advantages of Optical Fiber Noise resistance Less signal attenuation Light weight Disadvantages Cost Installation and maintenance Unidirectional Fragility (easily broken) Unguided media Unguided media transport electromagnetic waves without using a physical conductor. Unguided signals can travel from the source to destination in several ways: Ground propagation – waves travel through lowest portion on atmosphere.Single mode uses step-index fiber and a highly focused source of light that limits beams to a small range of angles. When an antenna transmits radio waves. Signals are normally broadcast through air and thus available to anyone who has device capable of receiving them. Fig: Omnidirectional antenna Disadvantages 12 | P a g e CS6551 COMPUTER NETWORKS . they are propagated in all directions. Radio waves. The omnidirectional property has a disadvantage. and paging systems. Infrared Electromagnetic waves with frequencies from 300 GHz to 400 THz are called infrared rays Infrared waves. Application programmer List the services that his or her application needs. Sending and receiving antennas need to be aligned Microwave propagation is line-of-sight Very high-frequency microwaves cannot penetrate walls a) ParabolicDish antenna b)Horn antenna Parabolic Dish antenna focus all incoming waves into single point Outgoing transmissions are broadcast through a horn aimed at the dish. REQUIREMENTS Connectivity Cost-Effective Resource Sharing Support for Common Services Performance Requirements differ according to the perspective: 1. Disadvantage If receivers are inside buildings. cannot penetrate walls. and wireless LANs. 13 | P a g e CS6551 COMPUTER NETWORKS . Properties Microwaves are unidirectional. such as radio and television. satellite networks. Microwaves Electromagnetic waves having frequencies between 1 and 300 GHz are called microwaves. Example: A guarantee that each message it sends will be delivered without error within a certain amount of time. they cannot receive these waves Applications Microwaves are used for unicast communication such as cellular telephones. Applications Infrared signals can be used for short-range communication in a closed area using line-of-sight propagation. having high frequencies. Applications Radio waves are used for multicast communications. that the radio waves transmitted by one antenna are susceptible to interference by another antenna that may send signals using the same frequency or band. we cannot isolate a communication to just inside or outside a building. As Radio waves can penetrate through walls. \ 3. Transparent to end user. Broadcast and Multicast Cost-Effective Resource Sharing Multiplexing is a way that a system resource is shared among multiple users. Connectivity A network must provide connectivity among a set of computers Links and Nodes Types of Links or Connections Direction of Data Flow Unicast. Example: The network resources efficiently utilized and fairly allocated to different users. Network designer List the properties of a cost-effective design. Network provider List the characteristics of a system that is easy to administer and manage. 14 | P a g e CS6551 COMPUTER NETWORKS .2. Multiplexing cost less. Two or more simultaneous transmissions on a single circuit. Example: Fault can be easily isolated and it is easy to account for usage. Carrier frequencies separated so signals do not overlap (guard bands) e. 15 | P a g e CS6551 COMPUTER NETWORKS .g. Type o Frequency division multiplexing (FDM) o Time division multiplexing (TDM) o Wave division multiplexing (WDM) Frequency Division Multiplexing FDM Each signal is modulated to a different carrier frequency. broadcast radio Channel allocated even if no data Wave Division Multiplexing Multiple beams of light at different frequency Carried by optical fiber Same general architecture as other FDM Number of sources generating laser beams at different frequencies Multiplexer consolidates sources for transmission over single fiber Optical amplifiers amplify all wavelengths Demux separates channels at the destination Time Division Multiplexing Multiple digital signals interleaved in time May be at bit level of blocks Time slots preassigned to sources and fixed Time slots allocated even if no data Time slots do not have to be evenly distributed amongst sources Type Synchronous Asynchronous. It allows the transmission of multiple signal across a single data link. File transfer:– High packet length. and the network's robustness in a catastrophe. However. We often need more throughputs and less delay. small reliability Video-conferencing– Variable/high packet length. protecting data from damage and development. Performance is often evaluated by two networking metrics: throughput and delay. The channel is a pipe connecting two applications. and the efficiency of the software. Reliability: In addition to accuracy of delivery. and security. security. including the number of users. we may increase throughput but we increase the delay because of traffic congestion in the network. Transit time is the amount of time required for a message to travel from one device to another. the type of transmission medium. How to fill the gap between the underlying network capability and applications requirements? a set of common services– Delivery guarantees. these two criteria are often contradictory. high reliability. If we try to send more data to the network. Response time is the elapsed time between an inquiry and a response. We don‘t want application developers to rewrite for each application higher layer networking services. high arrival rate Video-on-demand:– Variable/high packet length. Performance: Performance can be measured in many ways. small delay. and implementing policies and procedures for recovery from breaches and data losses. 16 | P a g e CS6551 COMPUTER NETWORKS . high delay. small delay. the capabilities of the connected hardware. small delay. Security: Network security issues include protecting data from unauthorized access. reliability. network reliability is measured by the frequency of failure. including transit time and response time. Types of Applications Interactive terminal and computer sessions:– Small packet length. The most important of these are performance. fixed delay. delay. high reliability Voice application:– Small packet length. small reliability. the time it takes a link to recover from a failure.Support for Common Services A computer network provides more than packet delivery between nodes. small reliability NETWORK CRITERIA A network must be able to meet a certain number of criteria. The performance of a network depends on a number of factors. and then add a sequence of layers. It defines the form and meaning of message exchanged between protocol peers to implement the communication service. First it defines a service interface to other objects on the same system that want to use its communication services. 2. One for request\reply service and the other for message stream service. each providing a higher level of service. It provides a more modular design. Addition of new services and modifications are easy to implement. A protocol provides a communication service that higher level objects use to exchange message. To help to deal this network designers have developed general blueprints called network architecture that guide the design and implementation of networks. The layer immediately above the hardware in this case might provide host to host connectivity. A simple network has two layers of abstraction sandwiched between the application program and the underlying hardware. Each protocol defines two different interfaces. Second a protocol defines a peer interface to its counterpart on another machine. It must evolve to accommodate changes in both the underlying technologies. It decomposes the problem of building a network into more manageable components. 17 | P a g e CS6551 COMPUTER NETWORKS . they have two types of channels. In this. The services provided at the higher layers are implemented in terms of the services provided by the lower layers. This interface defines the operations that local objects can perform on the protocol.NETWORK ARCHITECTURE A computer network must provide general. and the layer above it builds on the available host to host communication service and provides support for process to process channels. cost effective. fair and robust among a large number of computers. LAYERING AND PROTOCOL To reduce the complexity of getting all the functions maintained by one a new technique called layering technology was introduced. Features of layering are: 1. The general idea is that the services offered by underlying hardware. In process to process channels. the architecture contains several layers and each layer is responsible for certain functions. There are potentially multiple protocols at any given level. 18 | P a g e CS6551 COMPUTER NETWORKS . Transport layer 5. each providing a different communication service. Session layer 6. Each layer having unique responsibilities. Network layer 4. Mainly. OSI MODEL The open system interconnection model is a layered framework. It is a standard of ISO. OSI refers to Open System Interconnection that covers all aspects of network communication. Here open system is a model that allows any two different systems to communicate regardless of their underlying architecture. ARCHITECTURE The architecture of OSI model is a layered architecture. it is not a protocol it is just a model. ISO / OSI MODEL: ISO refers International Standards Organization was established in 1947. The seven layers are. 1. Presentation layer 7. It is known as protocol graph that make up a system. Datalink layer 3. Physical layer 2. Application layer The figure shown below shows the layers involved when a message sent from A to B pass through some intermediate devices. It has seven separate but interrelated layers. it is a multinational body dedicated to worldwide agreement on international standards. Network Support Layers 2.Both the devices A and B are formed by the framed architecture. physical addressing. 4. When the information added at the beginning of the data is known as header. 1. This is known as peer to peer process. and transport timing and reliability. Headers added at layers 2. User Support Layers 3. 6. 3. Intermediate Layer The transport layer is the intermediate layer between the network support and the user support layers. FUNCTIONS OF THE LAYERS PHYSICAL LAYER The physical layer coordinates the functions required to transmit a bit stream over a physical medium. Datalink and Network layers come under the group. Each layer in the sender adds its own information to the message. physical connections. Trailer added at layer 2. It deals with the mechanical and electrical specifications of the interface and the transmission medium. Each interface defines what information and services a layer must provide for the layer above it. They deal with the interoperability between the software systems. 5. Each layer is connected with the next layer by using interfaces. In every device each layer gets the services from the layer just below to it. When the device is connected to some other device the layer of one device communicates with the corresponding layer of another device. And the intermediate nodes only having the layers are physical. This information is known is header and trailers. ORGANIZATION OF LAYERS The seven layers are arranged by three sub groups. Presentation and Application layers comes under the group. User Support Layers: Session. They deal with the physical aspects of the data such as electrical specifications. Intermediate Layer Network Support Layers: Physical. Whereas added at the end then it called as trailer. 19 | P a g e CS6551 COMPUTER NETWORKS . Datalink and network. simplex 2. Two types of connection are. 1. Five topologies are. Physical Topology It defines how devices are connected to make a network. bus 5. point to point 2. tree 4. Representation of Bits To transmit the stream of bits they must be encoded into signal. 5. Data Rate It defines the transmission rate i. star 3. Synchronization of Bits The sender and receiver must be synchronized at bit level. ring 7. 1. It defines the types of transmission medium 2. Transmission Mode It defines the direction of transmission between devices. Line Configuration It defines the type of connection between the devices. mesh 2. the number of bits sent per second. 1. Three types of transmission are. 20 | P a g e CS6551 COMPUTER NETWORKS . multipoint 6. 1. Physical Characteristics Of Interfaces and Media: It defines the electrical and mechanical characteristics of the interface and the media. It defines the type of encoding weather electrical or optical. half duplex 3.The functions are.e. 4. 3. full duplex DATALINK LAYER Datalink layer responsible for node-to-node delivery. Framing It divides the stream of bits received from network layer into manageable data units called frames. Logical Addressing 21 | P a g e CS6551 COMPUTER NETWORKS . then the Datalink layer used to determine which device has control over the link at any given time. Error Control To improve the reliability the Datalink layer adds a trailer which contains the error control mechanism like CRC. If the sender and the receiver are in different networks. Access Control When two or more devices connected at the same link. The responsibilities are. NETWORK LAYER When the sender is in one network and the receiver is in some other network then the network layer has the responsibility for the source to destination delivery. 1. Flow Control It imposes a flow control mechanism used to ensure the data rate at the sender and the receiver should be same. Checksum etc. then the receiver address is the address of the device which connects the two networks. 4. 5. 2. 1. 3. Physical Addressing It adds a header that defines the physical address of the sender and the receiver.The responsibilities of Datalink layer are. Routing When more than one networks connected and to form an internetwork. It involves three steps. It adds a header that defines the port address which used to identify the exact process on the receiver. The transport layer gets the entire message to the correct process on that computer. It ensures the error control and flow control at source to destination level. To make this efficient each segment contains a sequence number. Connection Control The transport layer creates a connection between the two end ports. the connecting devices route the packet to its final destination. connection establishment 2. They are. Segmentation and Reassembly A message is divided into manageable units called as segments. 3. If a packet passes the network boundary that is when the sender and receiver are places in different network then the network layer adds a header that defines the logical address of the devices. It ensures that the whole message arrives in order and intact. data transmission 3. 1. The responsibilities are. Network layer provides this mechanism. connection discard 22 | P a g e CS6551 COMPUTER NETWORKS . 2. 1. 2. Service point Addressing A single computer can often run several programs at the same time. Each segment is reassembled after received that information at the receiver end. TRANSPORT LAYER The network layer is responsible for the end to end delivery of the entire message. Translation Different systems use different encoding systems. Flow Control Flow control is performed at end to end level 5. PRESENTATION LAYER The presentation layer is responsible for the semantics and the syntax of the information exchanged. Synchronization It adds a synchronization points into a stream of bits. 2. It establishes. Dialog Control The session layer allows two systems to enter into a dialog. It allows the communication between the devices. Error Control Error control is performed at end to end level. The presentation layer is responsible for interoperability between different systems. The responsibilities are. 23 | P a g e CS6551 COMPUTER NETWORKS .4. 1. 1. SESSION LAYER It acts as a dialog controller. The responsibilities are. maintains and synchronizes the interaction between the communication devices. The responsibilities are. Likewise. retrieve files. Mail Services It provides the basis for e-mail forwarding and storage. Compression It used to reduce the number of bits to be transmitted. 2. 24 | P a g e CS6551 COMPUTER NETWORKS . 3. Encryption To ensure security encryption/decryption is used Encryption means transforms the original information to another form Decryption means retrieve the original information from the encrypted data 3. APPLICATION LAYER The application layer enables the user to access the network. and manage or control files in a remote computer. and Management It allows a user to access files in a remote computer. It provides interfaces between the users to the network. Access. at the receiver side presentation layer translate the information from common format to receiver dependent format. The presentation layer t the sender side translates the information from the sender dependent format to a common format. 1. 4. 2. Network Virtual Terminal It is a software version of a physical terminal and allows a user to log on to a remote host. Directory Services It provides distributed database sources and access for global information about various objects and services. File Transfer. The application is free to bypass the defined transport layers and to directly use IP or one of the underlying networks. TCP and UDP provide alternative logical channels to application programs: TCP provides a reliable byte-stream channel. Fig Alternative view of the Internet architecture. logical internetwork The third layer contains two main protocols: the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP).1 Internet protocol graph. At the lowest level are a wide variety of network protocols. and UDP provides an unreliable datagram delivery channel.1. An alternative representation is given in Fig. The Internet Protocol (IP) supports the interconnection of multiple networking technologies into a single. and so on. NET2. is depicted in Fig. also called the TCP/IP architecture after its two main protocols.Summary of layers Internet architecture The Internet architecture. 25 | P a g e CS6551 COMPUTER NETWORKS . denoted NET1. The Internet architecture has three features: 1.2. Fig. int backlog) int accept(int socket. Application Programming Interface (Sockets) Most network protocols are implemented in software (especially those high in the protocol stack). the architecture allows for arbitrarily many different network technologies. int addr_len) int listen(int socket.‖ we are generally referring to the interface that the OS provides to its networking subsystem. each offering a different channel abstraction to application programs. Above IP can be arbitrarily many transport protocols.2. process. and nearly all computer systems implement their network protocols as part of the operating system. intaddr_len) int send(int socket. understanding a widely adopted API like Unix sockets gives us a good place to start. The advantage of industry-wide support for a single API is that applications can be easily ported from one OS to another. struct sockaddr *address. or graphic interfaces are the same. struct sockaddr *address. The existence of working implementations is required for standards to be adopted by the IETF. int msg_len. int flags) int recv(int socket. Just because two systems support the same network API does not mean that their file system. network applications and network protocols are very similar—the way an application engages the services of the network is pretty much the same as the way a high-level protocol invokes the services of a lowlevel protocol. IP serves as the focal point for the architecture—it defines a common method for exchanging packets among a wide collection of networks. and then goes on to identify the issues involved in implementing the protocols running within the network. char *message. int *addr_len) int connect(int socket. NETWORK SOFTWARE How to implement network software is an essential part of understanding computer networks. This section first introduces some of the issues involved in implementing an application program on top of a network. when we refer to the interface ―exported by the network. ranging from Ethernet to FDDI to ATM to single point-to-point links. int flags) 26 | P a g e CS6551 COMPUTER NETWORKS . struct sockaddr *address. char *buffer. Still. 3. int protocol) int bind(int socket. This interface is often called the network application programming interface (API). Each protocol provides a certain set of services. In many respects. int buf_len. and the API provides a syntax by which those services can be invoked in this particular OS. int type. and that developers can easily write applications for multiple OSs. Below IP. int socket(int domain. servaddr.n. n=read(sockfd.(struct sockaddr*)&servaddr. 27 | P a g e CS6551 COMPUTER NETWORKS .h> #include<netinet/in.n.buff.char *argv[]) { socklen_t len.connfd. which is similar to the program at the core of a web chat room. char srt[1024].stdout). return 0. The program also uses other Unix networking utilities.sizeof(servaddr)).h> #include<sys/socket. fputs(buff. servaddr.sin_family=AF_INET. close(sockfd). } SERVER PROGRAM #include<sys/types. write(sockfd.SOCK_STREAM.char *argv[]) { socklen_t len.s_addr=inet_addr(argv[1]). if(sockfd<0) perror("unable to create socket"). struct sockaddr_in servaddr.h> #include<sys/socket.cliaddr.h> int main(int argc. CLIENT PROGRAM: #include<sys/types. int sockfd. scanf("%s". servaddr.buff.cliaddr.&srt).sizeof(servaddr)).1024).Example Application The implementation of a simple client/server program that uses the socket interface to send messages over a TCP connection is discussed.sin_addr. Our application allows a user on one machine to type in and send text to a user on another machine.sin_port=htons(32666).h> #include<netinet/in.h> #include<stdio. struct sockaddr_in servaddr. char buff[1024]. bzero(&servaddr. int listenfd. It is a simplified version of the Unix talk program.1024). buff[n]='\0'. sockfd=socket(AF_INET.h> int main(int argc. connect(sockfd.0).h> #include<stdio. exit(0). bind(listenfd.1024). and similarly it provides the buffer into which an incoming message is copied when invoking the receive operation.sin_family=AF_INET.6. write(connfd. listen(listenfd.0).5). a thread. n=read(connfd. listenfd=socket(AF_INET.190 Hello Hello Server Program [213jecse000@localhost ~]$ cc echoserver.c [213jecse000@localhost ~]$ .sizeof(servaddr)).protocol interface found lower in the protocol graph.out 192. } OUTPUT Client Program [213jecse000@localhost ~]$ cc echoserver. for(. perror("unable to create a socket").1024). if(listenfd<0). bzero(&servaddr./a.buff. are allocated to all the current processes. such as address space and CPU cycles. This forces the 28 | P a g e CS6551 COMPUTER NETWORKS .(struct sockaddr*)&servaddr.168.char buff[1024]..(struct sockaddr*)&cliaddr. servaddr.s_addr=htonl(INADDR_ANY). Each process runs largely independently of other processes. return 0.out Protocol Implementation Issues The rest of this section discusses the two primary differences between the network API and the protocolto. } close(listenfd).sin_port=htons(32666). or alternatively. and the OS is responsible for making sure that resources. Process Model Most operating systems provide an abstraction called a process. connfd=accept(listenfd.sin_addr.SOCK_STREAM.c [213jecse000@localhost ~]$ . servaddr. Message Buffers A second inefficiency of the socket interface is that the application process provides the buffer that contains the outbound message when calling send. buff[n]=0.&len).sizeof(servaddr))./a.buff. servaddr.) { len=sizeof(cliaddr). g. PERFORMANCE Bandwidth and Latency Network performance is measured in two fundamental ways: bandwidth (also called throughput) and latency (also called delay). where the latency corresponds to the length of the pipe and the bandwidth gives the diameter of the pipe. this example channel (pipe) holds as many bytes as the memory of a personal computer from the early 1980s could hold. a transcontinental channel with a one-way latency of 50 ms and a bandwidth of 45 Mbps is able to hold 50×10−3 sec×45×106 bits/sec = 2. latency is critical Variance in latency (jitter) can also affect some applications (e. In other words. audio/video conferencing) How many bits the sender must transmit before the first bit arrives at the receiver if the sender keeps the pipe full takes another one-way latency to receive a response from the receiver If the sender does not fill the pipe send a whole delay × bandwidth product‘s worth of data before it stops to wait for a signal the sender will not fully utilize the network Delay × Bandwidth Product The product of these two metrics.topmost protocol to copy the message from the application‘s buffer into a network buffer. and vice versa. For example. etc. 29 | P a g e CS6551 COMPUTER NETWORKS . Latency = Propagation + transmit + queue Propagation = distance/speed of light Transmit = size/bandwidth One bit transmission => propagation is important Large bytes transmission => bandwidth is important Relative importance of bandwidth and latency depends on application For large file transfer. The bandwidth of a network is given by the number of bits that can be transmitted over the network in a certain period of time. often called the delay × bandwidth product.25 ×106 bits or approximately 280 KB of data. then the delay × bandwidth product gives the volume of the pipe—the maximum number of bits that could be in transit through the pipe at any given instant. NFS.). bandwidth is critical For small messages (HTTP.. A channel between a pair of processes as a hollow pipe . that is. its frame format is Fig: BISYNC Frame format 30 | P a g e CS6551 COMPUTER NETWORKS . FRAMING The stream of bits is not advisable to maintain in networks. Such a byte-oriented approach is exemplified by the BISYNC (Binary Synchronous Communication) protocol and the DDCMP (Digital Data Communication Message Protocol) Sentinel Approach The BISYNC protocol illustrates the sentinel approach to framing. the faster the program will be able to return the image to the user. They are. To achieve.The delay × bandwidth product is important to know when constructing highperformance networks because it corresponds to how many bits the sender must transmit before the first bit arrives at the receiver. To transmit frames over the node it is necessary to mention start and end of each frame. or stated another way. we are using several ways. If the application needs to support a frame rate of 30 frames per second. and there is eternal optimism that network bandwidth will continue to improve. Application Performance Needs A network-centric view of performance. The unstated assumption has been that application programs have simple needs—they want as much bandwidth as the network can provide. PPP. then the entire stream has to retransmitted. the more bandwidth that is available. This causes network designers to start thinking about what happens in the limit. There are three techniques to solve this frame Byte-Oriented Protocols (BISYNC. When an error occurs. The ability of the network to provide more bandwidth is of no interest to such an application because it has only so much data to transmit in a given period of time. we have talked in terms of what a given link or channel will support. High-Speed Networks The bandwidths available on today‘s networks are increasing at a dramatic rate. the framing concept is used. then it might request a throughput rate of 75 Mbps. view each frame as a collection of bytes (characters) rather than a collection of bits. in many respects their impact on how we think about networking comes in what does not change as bandwidth increases: the speed of light. what is the impact on network design of having infinite bandwidth available Although high-speed networks bring a dramatic change in the bandwidth available to applications. In this. DDCMP) Bit-Oriented Protocols (HDLC) Clock-Based Framing (SONET) Byte Oriented protocols In this. the stream of bits is divided into manageable bit units called frames. This is certainly true of the aforementioned digital library program that is retrieving a 25-MB image. To avoid this. The beginning of a frame is denoted by sending a special SYN (synchronization) character. The data portion of the frame is then contained between special sentinel characters: STX (start of text) and ETX (end of text). The SOH (start of header) field serves much the same purpose as the STX field. The frame format also includes a field labeled CRC (cyclic redundancy check) that is used to detect transmission errors. The problem with the sentinel approach is that the ETX character might appear in the data portion of the frame. BISYNC overcomes this problem by ―escaping‖ the ETX character by preceding it with a DLE (data-link-escape) character whenever it appears in the body of a frame; the DLE character is also escaped (by preceding it with an extra DLE) in the frame body. This approach is called character stuffing. Point-to-Point Protocol (PPP) The more recent Point-to-Point Protocol (PPP). The format of PPP frame is Fig: PPP Frame Format The Flag field has 01111110 as starting sequence. The Address and Control fields usually contain default values The Protocol field is used for demultiplexing. The frame payload size can he negotiated, but it is 1500 bytes by default. The PPP frame format is unusual in that several of the field sizes are negotiated rather than fixed. Negotiation is conducted by a protocol called LCP (Link Control Protocol). LCP sends control messages encapsulated in PPP frames—such messages are denoted by an LCP identifier in the PPP Protocol. Byte-Counting Approach The number of bytes contained in a frame can he included as a field in the frame header. DDCMP protocol is used for this approach. The frame format is Fig: DDCMP frame format COUNT Field specifies how many bytes are contained in the frame‘s body. Sometime count field will be corrupted during transmission, so the receiver will accumulate as many bytes as the COUNT field indicates. This is sometimes called a framing error. The receiver will then wait until it sees the next SYN character. Bit-Oriented Protocols (HDLC) In this, frames are viewed as collection of bits. High level data link protocol is used. The format is Fig: HDLC Frame Format HDLC denotes both the beginning and the end of a frame with the distinguished bit sequence 01111110. This sequence might appear anywhere in the body of the frame, it can be avoided by bit stuffing. 31 | P a g e CS6551 COMPUTER NETWORKS On the sending side, any time five consecutive 1‘s have been transmitted from the body of the message (i.e., excluding when the sender is trying to transmit the distinguished 01111110 sequence), the sender inserts a 0 before transmitting the next bit. On the receiving side, five consecutive 1‘s arrived, the receiver makes its decision based on the next bit it sees (i.e., the bit following the five is). If the next bit is a 0, it must have been stuffed, and so the receiver removes it. If the next bit is a 1, then one of two things is true, either this is the end-of-frame marker or an error has been introduced into the bit stream. By looking at the next bit, the receiver can distinguish between these two cases: 7 If it sees a 0 (i.e., the last eight bits it has looked at are 01111110), then it is the end-offrame marker. 8 If it sees a 1 (i.e., the last eight bits it has looked at are 01111111), then there must have been an error and the whole frame is discarded. Clock-Based Framing (SONET) Synchronous Optical Network Standard is used for long distance transmission of data over optical network. It supports multiplexing of several low speed links into one high speed links. An STS-1 frame is used in this method. It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead, with the rest being available for data. The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that enable the receiver to determine where the frame starts. The receiver looks for the special bit pattern consistently, once in every 810 bytes, since each frame is 9 x 90 = 810 bytes long. The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes from these frames are interleaved; that is, a byte from the first frame is transmitted, then a byte from the second frame is transmitted, and so on. Payload from these STS-1 frames can he linked together to form a larger STS-N payload, such a link is denoted STS-Nc. One of the bit in overhead is used for this purpose. 32 | P a g e CS6551 COMPUTER NETWORKS What is an Error ? • Whenever bits flow from one point to another, they are subject to unpredictable changes because of interference • The interference can change the shape of the signal, thus the bit value either from ―1‖ to ―0‖ or from ―0‖ to ―1‖ Error Detection • Data can be corrupted during transmission due to… • storms, accidents, sudden increase in electricity and voltage / decrease in signal power over distance • For reliable communication, errors must be detected and corrected Two Types of Errors • Single-Bit Errors : only one bit in the data unit has changed • Burst Errors of length „n‟ : 2 or more bits in the data unit have changed ( ‗n‘ is the distance between the FIRST and LAST errors in the data block ) Error Detection-General • Sender transmits every data unit twice • Receiver performs bit-by-bit comparison between that two versions of data • Any mismatch would indicate an error, which needs error correction • Advantage: very accurate • Disadvantage: time consuming : requires [ 2 x Transmission Time + Comparison Time ] Error Detection- Redundancy • Instead of repeating the entire data stream, a shorter group of bits may be appended to the end of each unit • Called as ―redundancy‖ because the extra bits are redundant to the information • Redundant information will be discarded as soon as the accuracy of the information has been determined Types of Redundancy Checks 33 | P a g e CS6551 COMPUTER NETWORKS .• Parity Check – Vertical Redundancy Check (VRC) – Longitudinal Redundancy Check (LRC) • Cyclic Redundancy Check (CRC) • Check Sum Error Detection-Parity Check • A redundant bit called ―Parity Bit‖ is added to every data unit • Even Parity : total number of 1‘s in the data unit becomes even • Odd Parity : total number of 1‘s in the data unit becomes odd Example of Using Parity Bits: Data: w o r l d 1110111 1101111 1110010 1101100 1100100 Sent As: 11101110 11011110 11100100 11011000 11001001 Corrupted: 11111110 11011110 11101100 11011000 11001001 Parity Check – Performance • Can detect all single-bit errors • Can also detect burst errors if the total number of bits changed is odd (1..3.5.) • Cannot detect errors where the total number of bits changed is even • Detects about 50% of errors 34 | P a g e CS6551 COMPUTER NETWORKS . we organize them in a table made of four rows and eight columns.LONGITUDINAL REDUNDANCY CHECK • In this. a block of bits is organized in a table (rows and columns). If odd number of 1s. the checker will not detect an error VERTICAL REDUNDANCY CHECK: It is also known as parity check. 35 | P a g e CS6551 COMPUTER NETWORKS . instead of sending a block of 32 bits. In even parity. • We then calculate the parity bit for each column and create a new row of eight bits which are the parity bits for the whole block LRC – Performance • Detects all burst errors up to length n (number of columns) • If two bits in one data unit are damaged and two bits in exactly same positions in another data unit are also damaged. In this technique a redundant bit called a parity bit is appended to every data unit so that the total number of 1s in the unit including the parity bit becomes even for even parity or odd for odd parity. the data unit is passed through the even parity generator. If the data unit having even number of 1s then it sets in the parity bit to maintain the number of 1s as even. then it sets 1 in the parity bit to make the number of 1s as even. It counts the number of 1s in the data unit. • For example. the remainder is the CRC. the incoming data unit is divided by the same number. If it counts odd number of 1s than there is no error. EXAMPLE The data is: 01010110 The VRC check: 01010111 CYCLIC REDUNDANCY CHECK CRC is based on binary division. If it counts even number of 1s than there is no error. Error Detection. Then the newly elongated data unit is divided by the divisor using a process called binary division. It counts the number of 1s in the data unit. In this a sequence of redundant bits. A remainder indicates that the data unit has been changed in transit and therefore must be rejected. Otherwise it having some error and it must be discarded. The remainder is CRC. called CRC remainder is appended to the end of a data unit so that the resulting data unit becomes exactly divisible by a second predetermined binary number. The CRC replaces the appended 0s at the end of the data unit. If at this step there is no reminder. If even number of 1s. At its destination. Otherwise there is some error. Here. a string of n-1 0s is appended to the data unit. When it reaches its destination. and appending it to the end of the data string must make the resulting bit sequence exactly divisible by the divisor. The data unit arrives at the receiver first. the data unit is assumed to be intact and therefore accepted. It must have exactly one less bit than the divisor. then it sets 1 in the parity bit to make the number of 1s as odd. The number of 0s is one less than the number of bits in the divisor which is n bits. Otherwise there is some error. the receiver puts all bits through an odd parity checking function. the receiver puts all bits through an even parity checking function. If the data unit having odd number of 1s then it sets in the parity bit to maintain the number of 1s as odd.CRC Generator 36 | P a g e CS6551 COMPUTER NETWORKS . EXAMPLE: The data is : 01010110 The VRC check : 010101100 In odd parity. followed by the CRC. First. The receiver treats whole string as the data unit and divides it by the same divisor that was used to find the CRC remainder. When it reaches its destination. the data unit is passed through the odd parity generator. If the remainder is 0 then the data unit is error free. checksum generator 2. 1. checksum checker Checksum Generator: • The sender follows these steps: – The data unit is divided into ―k‖ sections. • Reasons: – It is short – It can be used to prove the concept mathematically CHECKSUM The error detection method used by the higher layer protocols is called checksum. They are. each of ―n‖ bits 37 | P a g e CS6551 COMPUTER NETWORKS .Error Detection. It consists of two arts.CRC Checker Error Detection.CRC Polynomials • The divisor in the CRC generator is most often represented as an algebraic Polynomial. otherwise. – If the result is zero.– All sections are added using one‘s complement to get the sum – The sum is complemented and becomes the checksum. the data are accepted. each of ―n‖ bits – All sections are added using one‘s complement to get the sum. Checksum Checker: • The receiver follows these steps: – The unit is divided into ―k‖ sections. rejected EG: Error Correction Techniques • Retransmission When an error is discovered. – The sum is complemented. the receiver can ask the sender to retransmit the entire data unit 38 | P a g e CS6551 COMPUTER NETWORKS . – The checksum is appended and sent with the data. 4 and 8 i. 9. 3.x1. 7. • In the Hamming Code. 5. 10. which automatically corrects certain errors • Single-bit errors: • Can be detected by the addition of parity bit which helps to find ―error‖ or ―no error‖ which is sufficient to detect errors • To correct errors the receiver can simply invert 0 to 1 or 1 to 0. 3.x3 and so on. 2. 5. 11 39 | P a g e CS6551 COMPUTER NETWORKS . 6. 10.x2. 11 r3: bits 4.• Forward Error Correction : • A receiver can use an error-correcting code. 11 r2: bits 2. 9. which are placed in positions 1. 7. each “r” bit for one combination of data bits as below: r1: bits 1. 7 r4: bits 8. 6.e x0. but the problem is ―locating‖ the position of error • To do so requires enough redundancy bits • Condition: 2r >= m + r + 1 Error Correction-Hamming Code • Hamming Code can be applied to data units of any length and uses the relationship between data and redundancy bits • For example: a 7-bit ASCII code requires 4 redundancy bits that can be added to the end of the data unit or mixed with the original data bits. then the error does not corrupt M bits of one single unit. it corrupts only 1 bit of a unit. followed by the second bit of each and so on • In this way. if a burst error of M bits occurs (M<N).Example of Redundancy bit Calculation Error Correction-Burst Error Correction • Instead of sending all the bits in a data unit together.Example FLOW CONTROL It refers to a set of procedures used to restrict the amount of data flow between sending and receiving stations. It tells the sender how much data it can transmit before it must wait for an acknowledgement from the receiver. • Burst Error Correction . we can organize ―N‖ units in a column and then send the first bit of each . 40 | P a g e CS6551 COMPUTER NETWORKS . The advantage is simplicity. And the size of the window is n-1. The sliding window refers to imaginary boxes at both the sender and receiver. The disadvantage is inefficiency SLIDING WINDOW: In this method. Here the size of the window is 7 and the frames are numbered as 0.4. stop and wait 2. using a single ACK to confirm the receipt of multiple data frames. 1. the sender can transmit several frames before needing an acknowledgment.7. SENDER WINDOW: At the beginning the sender‘s window contains n-1 frames. then the sender sends the next frame.There are two methods are used.5.1.3. Only after an acknowledgment has been received. To identify each frame the sliding window scheme introduces the sequence number. sliding window STOP AND WAIT: In this method the sender waits for acknowledgment after every frame it sends. Once an ACK receives the window expands at the right side boundary to allow in a number of new frames equal to number of frames acknowledged by that ACK. shrinking the size of the window. This window provides the upper limit on the number of frames that can be transmitted before requiring an acknowledgement. As frames are sent out the left boundary of the window moves inward. They are.2. The frames are numbered as 0 to n-1. 41 | P a g e CS6551 COMPUTER NETWORKS .6. The receiver acknowledges only some of the frames. They are. So there are two types in error control. a negative acknowledgement is returned and the specified frame is retransmitted. stop and wait ARQ 2. sliding window ARQ 42 | P a g e CS6551 COMPUTER NETWORKS .Sliding Window Example ERROR CONTROL Error control is implemented in such a way that every time an error is detected. The error control is implemented with the flow control mechanism. 1. This process is called automatic repeat request (ARQ). 43 | P a g e CS6551 COMPUTER NETWORKS . then it retransmits the data frame. The receiver gets a duplicated copy of the data frame.STOP AND WAIT ARQ: It is a form of stop and wait flow control. The sending device waits for an ACK or NAK frame until its timer goes off. So it knows the acknowledgement was lost so it discards the second copy. it returns a NAK frame and the sender retransmits the last frame. DAMAGED FRAME: When a frame is discovered by the receiver to contain an error. extended to include retransmission of data in case of lost or damaged frames. LOST DATA FRAME: The sender is equipped with a timer that starts every time a data frame is transmitted. If the frame lost in transmission the receiver can never acknowledge it. It retransmits the last data frame. then it tries again. LOST ACKNOWLEDGEMENT: The data frame was received by the receiver but the acknowledgement was lost in transmission. The sender waits until the timer goes off. go-back-n ARQ 2. They are. selective reject ARQ GO-BACK-N ARQ: In this method.SLIDING WINDOW ARQ It is used to send multiple frames per time. if one frame is lost or damaged. 1. It has two types. all frames sent since the last frame acknowledged or retransmitted. The number of frame is according to the window size. The sliding window is an imaginary box which is reside on both sender and receiver side. LOST FRAME: DAMAGED FRAME: 44 | P a g e CS6551 COMPUTER NETWORKS . The receiver should have sorting mechanism. The selective transmission increases the efficiency of transmission and is more suitable for noisy link. DAMAGED FRAME: 45 | P a g e CS6551 COMPUTER NETWORKS .LOST ACK: SELECTIVE REPEAT ARQ Selective repeat ARQ re transmits only the damaged or lost frames instead of sending multiple frames. LOST FRAME LOST ACK 46 | P a g e CS6551 COMPUTER NETWORKS . DHCP.11 – Bluetooth .UNIT II MEDIA ACCESS & INTERNETWORKING 9 Media access control . ARP.Ethernet (802.Wireless LANs – 802. their frames will collide and the link bandwidth is wasted during collision How to coordinate the access of multiple sending/receiving nodes to the shared link??? • Solution: We need a protocol to coordinate the transmission of the active nodes • These protocols are called Medium or Multiple Access Control (MAC) Protocols belong to a sublayer of the data link layer called MAC (Medium Access Control) • What is expected from Multiple Access Protocols: – Main task is to minimize collisions in order to utilize the bandwidth by: • Determining when a station can use the link (medium) • what a station should do when the link is busy • what the station should do when it is involved in collision Data link layer divided into two functionality-oriented sublayers 47 | P a g e CS6551 COMPUTER NETWORKS . CIDR.Switching and bridging – Basic Internetworking (IP. ICMP) Multiple Access Broadcast link used in LAN consists of multiple sending and receiving nodes connected to or use a single shared link Broadcast links Examples PROJECT 802 AND OSI MODEL Data link layer is further subdivided into two sub layers: Logical Link Control (LLC) Medium Access Control (MAC) Multiple Access Problem: When two or more nodes transmit at the same time.3) . e. ALOHA Protocols • Was designed for wireless LAN and can be used for any shared medium • Pure ALOHA Protocol Description – All frames from any station are of fixed length (L bits) – Stations transmit at equal transmission time (all stations produce frames with equal frame lengths). Procedure for ALOHA protocol 48 | P a g e CS6551 COMPUTER NETWORKS . – A station that has data can transmit at any time – After transmitting a frame. Maximum Propagation Delay • Maximum propagation delay(tprop): time it takes for a bit of a frame to travel between the two most widely separated stations. the sender waits for an acknowledgment for an amount of time (time out) equal to the maximum round-trip propagation delay = 2* tprop – If no ACK was received.Taxonomy of multiple-access protocols Random Access Random Access (or contention) Protocols: – No station is superior to another station and none is assigned the control over another. it gives up – Channel utilization or efficiency or Throughput is the percentage of the transmitted frames that arrive successfully (without collisions) or the percentage of the channel bandwidth that will be used for transmitting frames without collisions – ALOHA Maximum channel utilization is 18% (i. sender assumes that the frame or ACK has been destroyed and resends that frame after it waits for a random amount of time – If station fails to receive an ACK after repeated transmissions. – A station with a frame to be transmitted can use the link directly based on a procedure defined by the protocol to make a decision on whether or not to send.18 * F frames will arrive successfully on average without the need of retransmission). then 0. if the system produces F frames/s. Critical time for pure ALOHA protocol If the frame transmission time is T sec. G = Average number of frames generated by the system (all stations) during one frame transmission time Random Access – Slotted ALOHA • Time is divided into slots equal to a frame transmission time (Tfr) • A station can transmit at the beginning of a slot only • If a station misses the beginning of a slot. Pure ALOHA In pure ALOHA. it has to wait until the beginning of the next time slot. then the vulnerable time is = 2 T sec. The maximum throughput Smax = 0. frames are transmitted at completely arbitrary times. This means no station should send during the T-sec before this station starts transmission and no station should start sending during the T-sec period that the current station is sending.184 when G= (1/2). 49 | P a g e CS6551 COMPUTER NETWORKS . The throughput ( S) for pure ALOHA is S = G × e −2G . should sense the medium for the presence of another transmission (carrier) before it starts its own transmission • This can reduce the possibility of collision but it cannot eliminate it. 50 | P a g e CS6551 COMPUTER NETWORKS .• A central clock or station informs all stations about the start of a each slot • Maximum channel utilization is 37% In danger time for slotted ALOHA protocol The throughput for slotted ALOHA is S = G × e−G . avoid transmissions that are certain to cause collisions • Based on the fact that in LAN propagation time is very small • If a frame was sent by a station. many collisions can occur and the rate allocated for each node will not be on average R/M bps This causes low channel utilization Carrier Sense Multiple Access (CSMA) • To improve performance. The maximum throughput Smax = 0.368 when G = 1. Advantage of ALOHA protocols A node that has frames to be transmitted can transmit continuously at the full rate of channel (R bps) if it is the only node with frames Simple to be implemented No master station is needed to control the medium Disadvantage If (M) nodes want to transmit. All stations knows immediately so they can wait before start sending – A station with frames to be sent. go to 2 2. otherwise. 2. should sense the medium 1. If medium is idle. (backoff) wait a random amount of time and repeat 1 Non-persistent Stations are deferential (respect others) Performance: 1.– Collision can only happen when more than one station begin transmitting within a short time (the propagation time period) Vulnerable time for CSMA is the maximum propagation time The longer the propagation delay. 1-Persistent CSMA 3. Random delays reduces probability of collisions because two stations with data to be transmitted will wait for different amount of times. If medium is busy. Non-Persistent CSMA 2. the worse the performance of the protocol because of the above case. Types of CSMA Protocols Different CSMA protocols that determine: What a station should do when the medium is idle? What a station should do when the medium is busy? 1. Bandwidth is wasted if waiting time (backoff) is large because medium will remain idle following end of transmission even if one or more stations have frames to send 51 | P a g e CS6551 COMPUTER NETWORKS . transmit. p-Persistent CSMA Nonpersistent CSMA A station with frames to be sent. 2. 1-persistent protocol used Station wishing to transmit listens to the medium: 1. transmit with probability (p). If medium busy. collision guaranteed P-persistent CSMA Time is divided to slots where each Time unit (slot) typically equals maximum propagation delay Station wishing to transmit listens to the medium: 1. Performance Reduces the possibility of collisions like nonpersistent Reduces channel idle time like 1-persistent Flow diagram for three persistence methods 52 | P a g e CS6551 COMPUTER NETWORKS . then repeat 1. If medium idle. then transmit immediately with probability 1 Performance 1-persistent stations are selfish If two or more stations becomes ready at the same time. 2. If medium busy. OR wait one time unit (slot) with probability (1 – p). continuously listen until medium becomes idle. If medium idle.1-persistent CSMA To avoid idle channel time. continuously listen until idle and repeat step 1 3. transmit immediately. CSMA/CD (Collision Detection) CSMA (all previous methods) has an inefficiency: If a collision has occurred. Sender stops transmission if collision has occurred reducing channel wastage . p-persistent) for transmission • If a collision is detected by a station during its transmission then it should do the following: – Abort transmission and – Transmit a jam signal (48 bit) to notify other stations of collision so that they will discard the transmitted frame also to make sure that the collision signal will stay until detected by the furthest station 53 | P a g e CS6551 COMPUTER NETWORKS .3. 1-persistent. the channel is unstable until colliding packets have been fully transmitted CSMA/CD (Carrier Sense Multiple Access with Collision Detection) overcomes this as follows: While transmitting. CSMA/CD Protocol • Use one of the CSMA persistence algorithm (non-persistent. the sender is listening to medium for collisions. Ethernet). CSMA/CD is Widely used for bus topology LANs (IEEE 802. then – Transmit the frame again Question: How long does it take to detect a collision? Answer: In the worst case.2 usec for Ethernet 10-Mbps LAN) After Kth collision. select a random number (R) between 0 and 2k –1 and wait for a period equal to (R*slot time) then retransmit when the medium is idle. twice the maximum propagation delay of the medium Note: a = maximum propagation delay Restrictions of CSMA / CD: Packet transmission time should be at least as long as the time needed to detect a collision (2 * maximum propagation delay + jam sequence transmission time) Otherwise.1} and wait for a period equal to R*slot times (Wait for a period 0 usec or 1x51. if K=10 Maximum interval {0 – 1023} Give up after 16 unsuccessful attempts and report failure to higher layers Flow diagram for the CSMA/CD 54 | P a g e CS6551 COMPUTER NETWORKS . CSMA/CD does not have an advantage over CSMA Exponential Backoff Algorithm • Ethernet uses the exponential backoff algorithms to determine the best duration of the random waiting period after the collision happens • Algorithm: Set ―slot time‖ equal to 2*maximum propagation delay + Jam sequence transmission time (= 51. for example: After first collision (K=1).• • • – After sending the jam signal. select a number (R) between 0 and 21 –1 {0 . backoff (wait) for a random amount of time.2 usec) then retransmit when the medium is idle Do not increase random number range. packet transfer has low-delay • However. (unfair protocol) • A node that has frames to be transmitted can transmit continuously at the full rate of channel (R) if it is the only node with frames • If (M) nodes want to transmit. Performance of Random Access Protocols • Simple and easy to implement • Decentralized (no central device that can fail and bring down the entire system) • In low-traffic. first-out effect – Stations with no or few collisions will have the chance to transmit before stations that have waited longer because of their previous unsuccessful transmission attempts. limited throughput and in heavier traffic. collisions increase. packet delay has no limit. a station may never have a chance to transfer its packet. • Exponential Back off algorithm gives last-in.• • • Reduces the chance of two waiting stations picking the same random waiting time When network traffic is light. • In some cases. it results in minimum waiting time before transmission As congestion increases ( traffic is high). many collisions can occur and the rate for each node will not be on average R/M Controlled Access or Scheduling • Provides in order access to shared medium so that every station has chance to transfer (fair protocol) • Eliminates collision completely • Three methods for controlled access: – Reservation – Polling 55 | P a g e CS6551 COMPUTER NETWORKS . stations backoff by larger amounts to reduce the probability of collision. … Select and poll functions in polling access method 56 | P a g e CS6551 COMPUTER NETWORKS . 2. Polling can be done in order (Round-Robin) or based on predetermined order Distributed polling No primary and secondary Stations have a known polling order list which is made based on some protocol station with the highest priority will have the access right first. every station knows which stations will transfer frames. If yes. One minislot for each of the N stations When a station needs to send a data frame. data will be transmitted otherwise NAK is sent.Polling Stations take turns accessing the medium Two models: Centralized and distributed polling Centralized polling One device is assigned as primary station and the others as secondary stations All data exchanges are done through the primary When the primary has a frame to send it sends a select frame that includes the address of the intended secondary When the primary is ready to receive data it send a Poll frame for each device to ask if it has data to send or not.– Token Passing 1-Reservation access method Stations take turns transmitting a single frame at a full rate ( R ) bps Transmissions are organized into variable length cycles Each cycle begins with a reservation interval that consists of (N) minislots. which will passes the access right to the following next station. and in which order. then it passes the access right to the next station (it will send a pulling message to the next station in the pulling list). By listening to the reservation interval. it makes a reservation in its own minislot. The stations that made reservations can send their data frames after the reservation frame. frequency. between different stations. or through code.FDMA • FDMA: Frequency Division Multiple Access: – Transmission medium is divided into M separate frequency bands – Each station transmits continuously on the assigned band at an average rate of R/M – A node is limited to an average rate equal R/M (where M is number of nodes) even when it is the only node with frame to be sent 57 | P a g e CS6551 COMPUTER NETWORKS . Frequency-Division Multiple Access (FDMA) Time-Division Multiple Access (TDMA) Code-Division Multiple Access (CDMA) CHANNELIZATION . In this section. we discuss three channelization protocols.CHANNELIZATION Channelization is a multiple-access method in which the available bandwidth of a link is shared in time. CHANNELIZATION .TDMA • TDMA: Time Division Multiple Access – The entire bandwidth capacity is a single channel with its capacity shared in time between M stations – A node must always wait for its turn until its slot time arrives even when it is the only node with frames to send – A node is limited to an average rate equal R/M (where M is number of nodes) even when it is the only node with frame to be sent 58 | P a g e CS6551 COMPUTER NETWORKS .FDMA • FDMA: Frequency Division Multiple Access: – Transmission medium is divided into M separate frequency bands – Each station transmits continuously on the assigned band at an average rate of R/M – A node is limited to an average rate equal R/M (where M is number of nodes) even when it is the only node with frame to be sent CHANNELIZATION . CDMA CDMA: Code Division Multiple Access In CDMA. one channel carries all transmissions simultaneously Each station codes its data signal by a specific codes before transmission The stations receivers use these codes to recover the data for the desired station Simple idea of communication with code Project 802 NORMAL ETHERNET OPERATION CSMA/CD(Carrier Sense/Multiple Access with Collision Detection) 59 | P a g e CS6551 COMPUTER NETWORKS .CHANNELIZATION . multiple accesses with collision detect (CSMA/CD) local area network technology. Length/type – two bytes indicating number of bytes in coming PDU(protocol data unit) . The Last two bits(11) alerts the receiver that the next field is the destination address. Ethernet provides an unrealiable medium (no acknowledgemet) Preamble – seven bytes of alternating 0s and 1s to notify receiver of incoming frame and to provide synchronization Start frame delimiter (SFD) – tells the station that they have a last chance for synchronization. if a collision. Data Rate: Traditional Ethernet: 10 Mbps Fast Ethernet : 100 Mbps Gigabit Ethernet : 1 Gbps TRADITIONAL ETHERNET IEEE802. this field contains the physical address of the router. upon reaching the target network. Data – 46 to 1500 bytes CRC – CRC-32 error detection information 60 | P a g e CS6551 COMPUTER NETWORKS . backoff and try again Evolution of CSMA/CD Ethernet (802. listen while talking. Fast Ethernet and Gigabit Ethernet are the three generations of Ethernet.3) Ethernet is a multiple access network which means a collection of nodes tranmit and receive data frames through a shared link. field then contains the physical address of the destination device Source address (SA) – six byte field containing physical address of last station to forward packet. Ethernet was first widely used in high speed LAN.Many stations.persisent CSMA /CD as the Access method. The Ethernet is developed in the mid-1970 by researches at the Xerox Palo Alto Research Center (PARC). The Ethernet is a working example of the more general carrier sense. Destination address (DA) – six bytes containing the physical address of the next destination. Traditional Ethernet. It uses 1. The most dominant LAN technology today is Ethernet.3: FRAME FORMAT: The Ethernet frame consists of seven fields. Listen before talking.. if packet must reach another LAN. sending station . It is also known as thick net or thick Ethernet. 10Base2. 10-Base-T. allowing concurrent communications. A segment of the original 10Base5 cable can be up to 500m long. Separates collision domains since traffic is lower with segmentation SWITCHED ETHERNET In switched networks.3 model is called 10Base5.Also helps to improve security FAST ETHERNET 61 | P a g e CS6551 COMPUTER NETWORKS . cheapnet. 10BASE-FL: FIBER LINK ETHERNET Uses star topology to connect stations to a hub. CATEGORIES OF TRADITIONAL ETHERNET: Baseband – digital signals using Manchester encoding 10Base5.ETHERNET ADDRESSING Each station on the network must have a unique physical address Provided by a six-byte physical address encoded on the network interface card (NIC) Normally written in hexadecimal notation UNICAST MULTICAST BROADCAST : Addresses are used to send messages to specific device. 10Base-FL 10Base5: The first of the physical standards defined in the IEEE 802.It also known as thin-net. 10Base2.3 series is 10BaseT. Only specification: 10Broad36 STANDARDS: There are various standards of Ethernet. a switch device recognizes the destination address and routes the frame to the specific port to which the destination station is connected (enables point-to-point connection. 10Base2: The second implementation defined by the IEEE892 series is called 10Base2. BRIDGED ETHERNET Increases bandwidth by dividing the network into smaller networks. The ―T‖ stands for twisted pair.The stations are connected to a hub using two fibre optic cables. 10-Base-T. : Addresses are used to send messages to group of devices. : address are just used to send messages in the network who are in the need of messages can use it. thinwire Ethernet or thin Ethernet. A 10BaseT segment is usually limited to less than 100m in length. The Traditional Ethernet standards are: 10Base5. ―Base‖ refers to the fact that the cable is used in a base band system and the ―2‖ means that a given segment can be no longer than 200m 10BaseT: The most popular standard defined in the IEEE 802. no collisions) . 10Base-FL First number indicates data rate in Mbps Last number indicates maximum cable length or type Broadband – analog signals using digital/analog conversion. cheapernet. In this ―10‖ means the network operates at 10 Mbps. It is also known as twisted pair Ethernet. Suppose host A begins transmitting a frame at time t. Because there is no centralized control it is possible for two (or more) adaptors to begin transmitting at the same time. Each sender.500m. At the moment an adaptor detects that is frame is colliding with another. faster speeds needed for CAD. or access method Data rate and collision domain are changed Physical implementation is star topology 100Base-X (100Base-TX and 100Base-FX) 100Base-T4 GIGABIT ETHERNET Data rate of 1000 Mbps or 1 Gbps 1000Base-X uses shortwave optical fiber (1000Base-SX).5 m apart. taps must be at least 2. because the Ethernet supports collision detection. long-wave optical fiber (1000Base-LX). TRANSMITTER ALGORITHM: The transmitter algorithm is defined as follows: When the adaptor has a frame to send and the line is busy. A repeater is a device that forwards digital signals. much like an amplifier forwards analog signals. the two (or more) frames are said to collide on the network. except that it typically has an impedance of 50 ohms instead of cable TV‘s 75 ohms. meaning that an Ethernet has a total reach of only 2. connected to an Ethernet adaptor. Operates at 100 Mbps. image processing. When this happens. real-time audio and video No change in frame format.024 hosts. it takes it one link latency (let‘s denote the latency as d) for the frame to reach host B. Hosts connect to an Ethernet segment by tapping into it. Multiple Ethernet segments can be joined together by repeater. An Ethernet is limited to supporting a maximum of 1. addressing. in turn. no more than four repeaters may be positioned between any pair of hosts. this cable is similar to the type used for cable TV. it waits for the line to go idle and then transmits immediately. The Ethernet is said to be a 1-persistent protocol because an adaptor with a frame to send transmits with probability 0<=p<=1 after a line becomes idle. it first makes sure to transmit a sure to transmit a 32-bit jamming sequence and then stops the transmission. the first bit of A‘s 62 | P a g e CS6551 COMPUTER NETWORKS . It also receives incoming signals. either because both found the line to be idle or because both had been waiting for a busy line to become idle. A transceiver a small device directly attached to the tap detects when the line is idle and drives the signal when the host is transmitting. which is plugged into the host. The transceiver is. is able to determine that a collision is in progress. as shown in (a). Thus. or twisted-pair cables (1000Base-T) PHYSICAL PROPERTIES: An Ethernet segment is implemented on a coaxial cable of up to 500m. Terminators attached to the end of each segment absorb the signal and keep it from bouncing back and interfering with trailing signals. However. and defers with probability q=1-p. The encoding method used is differential manchester encoding method. Station function as a repeater. as described above. host A will not know that the collision occurred until B‘s frame reaches it.e. Suppose an instant before host A‘s frame arrives (i. as shown in (b). ACCESS METHOD: TOKEN PASSING : Whenever the network is unoccupied it circulates a simple three byte token. station takes token and sends data frame.. the adaptor doubles the amount of time it waits before trying again. After transmitting the Token is released so the next station can transmit. it captures the token and sends one or more frames. Host A must continue to transmit until this time in order to detect the collision.5: TOKEN RINGS (802. passes to neighbor Each station receives the frame one by one and examines the destination address 63 | P a g e CS6551 COMPUTER NETWORKS . IEEE 802. if station has data to send. Frame is passed to each station in sequence.5) Token Ring allows each station to send one frame per turn. host B will send the 32-bit jamming sequence. The Station can send only when it receives a special frame called a token. A collection of an individual point to point links makes a circle. In other words.(B‘s frame will be a runt). at time t+2xd. The Token circulates around the ring. Each time it tries to transmit but fails. B still sees and idle line). host A must transmit for 2xd should be sure that it detects all possible collisions.frame arrives at B at time t+d. host B begins to transmit its own frame. If station wishes to send. if not. and this collision will be detected by host B as shown in (c).Token is a specially formatted three-byte frame that circulates. station wishing to transmit must first have possession Token passes from NIC to NIC in sequence. Unfortunately. Output port on each station connected to input port on the next. Once an adaptor has detected a collision and stopped its transmission. A ring network has a collection of nodes connected in a ring. it waits certain amount of time and tries again. The mechanism that coordinates this rotation is called token passing. which will happen one link latency later. B‘s frame will immediately collide with A‘s frame. as shown in (d). Suppose both A and C want to communicate with B and so they each send it a frame.11 standard. also known as Wi-Fi. office buildings. WIRELESS LAN Wireless technologies differ in variety of dimensions. it knows the frame was received and copied Sender then discards the frame and releases the token back to the ring.11): This section takes a closer look at a specific technology centered on the emerging IEEE 802. most notably in how much bandwidth they provide and how far apart communicating nodes can be. The first level is no mobility. campuses) and its primarily challenge is to mediate access to a shared communication medium in this case. BASE STATION.16) ► Third generation or 3Gcellular wireless. COLLISION AVOIDANCE: A wireless protocol wait until the link becomes idle before transmitting and back off should a collision occur. Wi-Fi is technically a trademark. Four prominent wireless technologies: ► Blue tooth ► Wi-Fi(more formally known as 802. However. but unlike an Ethernet. that is. The third level is mobility between bases. usually has no mobility. WI-FI (802. the two endpoints are usually different kinds of nodes. The most widely used wireless links today are usually asymmetric. These two frames collide with each other at B. as is the case with the initial version of WiMAX. it is often useful to create a point to point link abstraction for higher layer protocols. A ―client node‖ is often mobile. because radio waves sent by one device can be simultaneously received by many devices. Other important differences include which part of the electromagnetic spectrum they use (including whether it requires a license) and how much power they consume. The second level is mobility within the range of a base. Wireless communication naturally supports point to multipoint communication. A and C are said to be hidden nodes with respect to each other. station checks the frame for errors.11. signals propagating through space. such as when a receiver must be in a fixed location to receive a directional transmission from the base station. frame is copied. A and C are unaware of each other since their signals do not carry that far. as is the case with Bluetooth. If it matches.11) ► WiMAX(802. as is the case with cell phones and Wi-Fi. This topology implies three qualitatively different levels of mobility. neither A or C is aware of this collision. 802. it examines the address-recognized bits If they are set. Nodes are serviced in a round-robin fashion. Consider the situation where A and C are both within range of B but not each other. but has a wired (or at least high bandwidth) connection to the internet or other networks. and relies on its link to the base station for all its communication with other nodes.11 is designed for use in a limited geographical area (homes. changes bits to indicate the frame was received and copied Packet continues around the ring and is passed back to originating station Once the sender receives the frame and recognizes its address in the sender field. owned by a trade group called the Wi-Fi alliance that certifies product compliance with 802. 64 | P a g e CS6551 COMPUTER NETWORKS . Wireless LAN can connect roaming devices to the internet. however. The receiver then replies with a clear to send (CTS) frame. the sender transmits a Request to send (RTS) frame to the receiver. 802. This is not a problem since C‘s transmission to D will not interfere with A‘s ability to receive from B. It Operates on physical and data link layers. Any node that sees the RTS frame will collide with each other.A related problem called the exposed node problem where each of the four nodes is able to send and receive signals that reach just the nodes to its immediate left and right. The standard defines two kind of services: 1.11 does not support collision detection. This frame echoes this length field back to the sender. while C can reach B and D but not A. for C to conclude that it cannot transmit to anyone just because it can hear B‘s transmission. The idea is for the sender and receiver ot exchange control frames with each other before the sender actually transmits any data. This exchange informs all nearby nodes that a transmission is about to begin. The amount of time a given node delay is defined by the same exponential backoff algorithm used on the Ethernet. For EX: a B can exchange frames with A and C but it cannot reach D . the RTS frame includes a field that indicates how long the sender wants to hold the medium. Node C is aware of this communication because it hear B‘s transmission. For example.11 addresses these two problems with an algorithm called multiple access with collision avoidance (MACA). Without an AP is an ad hoc architecture 65 | P a g e CS6551 COMPUTER NETWORKS . Basic service set (BSS) – stationary or mobile wireless stations and a central base station known as an access point (AP). 802. It would be a mistake. but instead the senders realize the in which case they each wait a random amount of time before trying again. Specifically. WIRELESSLAN: Wireless LAN is one of the fastest growing technologies. suppose C wants to transmit to node D. Suppose B is sending to A. address 1. 5.used for initial communication between stations and access points. Retry:. D.when set to 1 means encryption is implemented. Frame control(FC)-defines the type of the frame and some control information. data frame(10). Subfields in FC are: 1. but confined inside one ESS ESS-transition mobility – can move from one ESS to another FRAME FORMAT: The MAC layer frame format consist of nine fields. Type :.2. more data:.control frame(01).defines the subtype of each type 3. Management frame. c.used for accessing the channel and acknowledging frames. Management frame(00). means more fragments 4. 6.2. power management:. subtype:.when set to 1 means retransmitted frame.defines the duration of transmission that is used to set the value of NETWORK 66 | P a g e CS6551 COMPUTER NETWORKS . 8.when set to 1 means station has more data to send. Communication between two stations in two different BSS usually occurs via two AP‘s. STATION TYPES: IEEE 802.when set to 1 means station is in power management mode. wep.4 depends on the TO DS AND FROM DS field.define sthe type of information carried in the frame body. 2. rsvd-reserved. No-transition mobility – either stationary or moving only inside a BSS BSS-transition mobility – can move from one BSS to another. Data frames-used for carriying data and control information. Extended service set (ESS) – two or more BSSs with APs connected through a distribution system (wired LAN) in an infrastructure network. Control frames.11 defines three types of stations based on their mobility in a wireless LAN.3. 7. a. Address : There are 4 address fields . More flag-when set to 1. b. The frame is going from a station to an AP.and other personal or peripheral devices. CASE 4: INTRA BSS THROUGH WIRELESS ESS: TO DS=1 FROM DS=1 In this the DS is also wireless. The frame is coming from an AP and going to a station. 67 | P a g e CS6551 COMPUTER NETWORKS .1 mbps.(e.defines the sequence number of the frame to be used in flow control. CASE 2: FROM DISTRIBUTION SYSTEM TO BSS: TO DS=0 FROM DS=1 The frame is coming from a DS. Frame Body:. ADDRESSING MECHANISM: WIRELESS LAN USE CASE 1: TO DS=0 . Version 2.g) Bluetooth can be used to connect a mobile phone to a headset or a notebook computer to a printer. Power consumption is low.The frame is going from one station in a BSS to another without passing through the DS. It has arrange of only about 10m.0 provides speeds up to 2. A Bluetooth fills the niche of very short range communication between mobile phones .contains information based on the type and subfield defined in the FC field. Because the communicating devices typically belong to one individual or group .FROM DS=0 The Frame is not going to a DS and is not coming from a DS . PDA‘s notebook computers .45GHZ. ALLOCATION VECTOR(NAV). CASE 3: TO DISTRIBUTION SYSTEM FROM BSS: TO DS=1 FROM DS=0 The frame is going to a DS. Bluetooth operates in the license –exempt band at 2. FCS:-contains a CRC-32 bit error detection sequence. SC(sequence control). The frame is going from one AP to another AP in a wireless DS BLUETOOTH Bluetooth is used to connect two devices without wire. Bluetooth is sometimes categorized as a personal area network(PAN). A slave device can be parked: set to an inactive. In the upstream how a connection get s handled depends on its QoS( Quality of service) parameters. A piconet can have upto 255 parked devices in addition to its active slave devices. The terms 'scatternet' and 'piconet' are typically applied to Bluetooth wireless technology. A European alternative to WIMAX is HIPERMAN which stands for High performance radio metropolitan area network uses 2-11 GHz range. Any communication is between the master and a slave.16. separate piconet. The network ranges from two to eight connected devices. which limits network and data sharing capability. low power state. thereby preventing any contention between the slave devices. about the size of a living room. 68 | P a g e CS6551 COMPUTER NETWORKS . Scatternets can be formed when a member of one piconet (either the master or one of the slaves) elects to participate as a slave in a second.16 WiMAX stands for Worldwide Interoperability for Microwave access was designed by the WiMAX Forum and standardized as IEEE 802. but only in response to a request from the master during the previous slot.called a piconet consists of a master devices and up to seven slave devices. The downstream channel is relatively easy to subdivide into connections since only the base station send so that channel.. The slave do not directly communicate with each other. which means very small. A piconet is sometimes called a personal area network (PAN) because the range of optimal operation for Bluetooth is 10 meters. so communication is limited to line of sight (LOS). It was originally conceived as a last mile technology(1 to 6 miles) and being classified as a metropolitan network (MAN). WIMAX -802. Data transfer rates vary from 200 to 2. one device takes the role of the master while all the other devices act as slaves. When a network is established. it can only be reactivated by the master. Piconet gets its name from the word "pico". WiMAX provides upto 70 Mbps to a single subscriber station. SCATTERNET: A scatternet is a type of ad hoc computer network consisting of two or more piconets. The frequency range is 10-66 GHz range. The physical layer protocols provide two ways to divide the bandwidth between upstream and downstream traffic: time division duplex (TDD) and FDD ( Frequency division duplex) Sharing of the upstream and downstream channels is based on dividing them into equal sized time sots.The basic Bluetooth configuration . A WiMAX frame generally takes up multiple slots with different frames taking different number of slots. A parked device cannot communicate on the piconet.100 kbps at the application. In this range waves travel in straight lines. Only master can start to transmit in odd numbered slots. A salve can start to transmit in an even numbered slot. A piconet is a network of devices connected using Bluetooth technology. This very small network is so called because the number is limited to seven devices. plus the master. GPRS has proven quite useful and popular in some parts of the world as a way to communicate wirelessly when faster connections methods are not available. 69 | P a g e CS6551 COMPUTER NETWORKS .CELL PHONE TECHNOLOGIES In cell phone technology data services based on cellular standards. Abase station could serve a single cell or use multiple directional antenna to serve multiple cells. Satphones are also larger and heavier than modern cell phones because of the need to transmit and receive over much longer distances to reach satellites rather than cellphone towers. the call must be transferred to the new base station in what is called a handoff. One way is a combination of FDM and TDM. communicating on frequency bands that have been reserved internationally for satellite use. GSM technology make use of multiplexing technique called time division multiple access (TDMA). 2G technologies use one of the two approaches to sharing a limited amount of spectrum between simultaneous calls.5 G data standards have also available and some manage to be quite higher in bandwidth than GPRS. BRIDGES AND SWITHCHES LAN may need to cover more distance than the media can handle effectively. Satphones or satellite phones use communication satellites as base stations. Common devices used: repeaters. bridges. but rather uses different chipping code to distinguish the transmissions of different cellphone users. UMTS (Universal Mobile Telecommunications System) is based on wideband CDMA. Other 2. or Number of stations may be too great for efficient frame delivery or management of the network. CDMA does not divide the channel in either time or frequency. If the phone is involved in a call at the time. UMTS is intended to support data transfer rates of upto 1. The frequency bands that are used for cellular telephones vary around the world. The geographic area served by the base stations antenna is called a cell. An internetwork or internet is two or more networks connected for exchanging resources.92 Mbps. routers and gateways CONNECTING DEVICES Repeaters and hubs – layer one of Internet model Bridges and two-layer switches – first two layers Routers and three-layer switches – first three layers Routers-operates at all five layers. sends a refreshed copy Only forwards frames. creates a copy. Does not change the MAC addresses in a frame. Bridges regenerates the signal it receives. regenerates the original pattern. Operate in both physical and data link layers Keeps traffic from each segment separate. then the frame is forwarded via the corresponding port no found in the table. Connects stations in a physical star topology Also may create multiple levels of hierarchy to remove length limitation of 10Base-T BRIDGES: Bridges are used to connect network segments. If it maps . Receives signal before too weak or corrupted. does not filter. Connects two segments of the same LAN.REPEATERS Operate only in physical layer. bit for bit. Does not amplify. If there is no mapping then the frame is discarded. useful for controlling congestion and provides isolation. Bridges Checks if the destination address of a frame matches with an entry in bridge table. Builds table by examining destination and source address of each packet it receives 70 | P a g e CS6551 COMPUTER NETWORKS . as well as security. at the original strength HUBS: Actually a multiport repeater. Source routing bridge TRANSPARENT BRIDGES: If the stations are completely unaware of the bridge existence. entries are added over time. Transparent bridge 2. Stations respond and bridge updates routing table with segment and station ID info.reconfiguration of the stations is unnecessary. Changes on the network are updated as they occur HOST A B C X Y Z 71 | P a g e PORT 1 1 1 2 2 2 CS6551 COMPUTER NETWORKS .TYPES OF BRIDGES: 1. Looping problem occurs.(eg) learning bridge. If a bridge is added or deleted from the system . When a bridge first boots. Having a human maintain this table is quite a burden. this table is empty. then the bridge is called Transparent bribge. so a bridge can learn this information for itself. The idea is for each bridge to inspect the source address in all the frames it receives. LEARNING BRIDGES: Bridges maintains a forwarding table which contains each host with their port number. ************************************************************************ NETWORK ALLOCATION VECTOR: If a channel is idle then a station sends the RTS. but B5 is the designated bridge since it is closer to the root. SOURCE ROUTING BRIDGE: Source routing bridges eliminates loop problem. and so on. . So loops can be eliminated. Routers: • A router is a three layer device that routes packets based on their logical addresses. 5. B2. a topology is created in which there is only one path from a LAN to another LAN. First elects the bridge with the smallest id as the root of the spanning tree. 2. IP 72 | P a g e CS6551 COMPUTER NETWORKS . • It can be used as a connecting device between two internetworks that use different models. but B5 is the designated bridge even they are equally closer to the root since B5 having smallest ID. B1 is the root bridge since it having the smallest ID. Similarly B5 and B7 are connected to LAN B. till which the station does not check the idleness of the channel. In the above example. Both B3 and B5 are connected to LAN A. Gateway • Gateway takes an application messages. When a station sends an RTS frame it include the duration of time. it occupies the channel. Each bridge has a unique identifier. SWITCH A switch is a small hardware device that joins multiple computers together. all the bridges connected to a given LAN elect a single designated bridge that will be responsible for forwarding frames toward the root bridge. After NAV has expired. a switch forwards it only to the port that connects to the destination device. B3. This port is also selected as the bridge‘s preferred path to the root. 3. destination address and also the addresses of bridges to be visited. Finally. In source routing each frame contains the source address. ie B1. A hub forwards the data it receives to all of the ports on the device. then the bridges‘ identifiers are used to break ties. Other station that needs the channel starts the timer called Network Allocation Vector (NAV). 4. STEPS TO BUILD SPANNING TREE: 1.SPANNING TREE ALGORITHM (PORT SELECTION): Spanning tree is a graph with no loop. If two or more bridges are equally close to the root. Using spanning tree . The root bridge always forwards frames out over all of its ports. read it and interprets it. stations check the channel and if it free any one station sends its RTS. the smallest id wins. Each bridge computes the shortest path to the root and notes which of its ports is on this path. In this figure.2 73 | P a g e CS6551 COMPUTER NETWORKS . although IP makes every effort to deliver datagrams. and that is all it has to do. which provides a way to identify all hosts in the internetwork. 3.1 A simple internetwork. Figure 3. or in any way fails to reach its intended destination. the network does nothing—it made its best effort.2. For example. it makes no guarantees. misdelivered. Every datagram carries enough information to let the network forward the packet to its correct destination. This is sometimes called an unreliable service. Sometimes they can get delivered out of order. This service model is sometimes called best effort (unreliable service) because. The ―best-effort‖ part means that if something goes wrong and the packet gets lost. corrupted. we see Ethernets.2. Datagram Delivery The IP datagram is fundamental to the Internet Protocol. An internetwork is often referred to as a ―network of networks‖ because it is made up of lots of smaller networks. Best-effort delivery does not just mean that packets can get lost.2.1 shows an example internetwork. and a point-to-point link. You just send it. and the network makes its best effort to get it to the desired destination. The higher-level protocols or applications that run above IP need to be aware of all these possible failure modes. Service Model Using IP. The IP service model can be thought of as having two parts: an addressing scheme. and sometimes the same packet can get delivered more than once. Each of these is a single-technology network. to refer to an arbitrary collection of networks interconnected to provide some sort of host-tohost packet delivery service. there is no need for any advance setup mechanism to tell the network what to do when the packet arrives.” or sometimes just “internet” with a lowercase i. When we are talking about the widely used. like most packets.What Is an Internetwork? We use the term “internetwork. It does not make any attempt to recover from the failure. Hn = host. we call it the “Internet” with a capital I. global internetwork to which a large percentage of networks are now connected. Packet Format The IP datagram. The format of the header is shown in Figure 3. consists of a header followed by a number of bytes of data. a corporation with many sites might construct a private internetwork by interconnecting the LANs at their different sites with point-to-point links leased from the phone company. Rn = router. Fig. and a datagram (connectionless) model of data delivery. an FDDI ring. we can provide a host-to-host service. A datagram is a type of packet that happens to be sent in a connectionless manner over a network. rather than let them consume resources indefinitely. However. the Length field counts bytes rather than words. it became more of a hop count than a timer. and many other protocols that may sit above IP in the protocol graph. TTL : Moving on to the third word of the header. Thus. the header is 5 words (20 bytes) long. TOS : The 8-bit TOS (type of service) field has had a number of different definitions over the years.IPv4 Packet Header Version: The Version field specifies the version of IP. Checksum : This field is calculated by considering the entire IP header as a sequence of 16-bit words. however. most routers just decremented the TTL by 1 as they forwarded the packet. For example. HLen. All the fragment of a datagram contain the same identification value Flags : DF – Don‘t fragment. but its basic function is to allow packets to be treated differently based on application needs. specifies the length of the header in 32-bit words. and the details of its use are presented under ―Fragmentation and Reassembly‖ below. and it is sometimes called IPv4. For this reason. Length : The next 16 bits of the header contain the Length of the datagram. the maximum size of an IP datagram is 65. The current version of IP is 4. The physical network over which IP is running. TTL was set to a specific number of seconds that the packet would be allowed to live. Its name reflects its historical meaning rather than the way it is commonly used today. may not support such long packets. IP supports a fragmentation and reassembly process. the next byte is the TTL (time to live) field. adding them up using ones complement arithmetic. the TOS value might determine whether or not a packet should be placed in a special queue that receives low delay. MF. The value 64 is the current default. set it too low and they may not reach their destination. HLen : The next field. which is most of the time. Thus. since it was rare for a packet to sit for as long as 1 second in a router. The intent of the field is to catch packets that have been going around in routing loops and discard them. One subtlety is in the initial setting of this field by the sending host: Set it too high and packets could circulate rather a lot before getting dropped. including the header. The second word of the header contains information about fragmentation. and routers did not all have access to a common clock.535 bytes. When there are no options. Unlike the HLen field. UDP (17).More fragment Offset :Max 8192 fragment per datagram Protocol : This field is simply a demultiplexing key that identifies the higher-level protocol to which this IP packet should be passed. Ident : It allows the destination host to determine which datagram a newly arrived fragment belongs to. which is still a perfectly good way to catch packets that are stuck in routing loops. There are values defined for TCP (6). and taking the ones complement of 74 | P a g e CS6551 COMPUTER NETWORKS . Originally. and routers along the path would decrement this field until it reached 0. To enable these fragments to be reassembled at the receiving host. The central idea here is that every network type has a maximum transmission unit (MTU). however. it can choose any size that it wants. When a host sends an IP datagram. For example.3 shows the binary and dotted decimal representation of the IP address 128. Fragmentation typically occurs in a router when it receives a datagram that it wants to forward over a network that has an MTU that is smaller than the received datagram.3. the host gives up on the reassembly process and discards the fragments that did arrive. Since all fragments of the original datagram contain this identifier. which is the largest IP datagram that it can carry in a frame. The presence or absence of options may be determined by examining the header length (HLen) field. as a result. An IP address is a 32 bit binary number usually represented as 4 decimal values. This identifier is chosen by the sending host and is intended to be unique among all the datagrams that might arrive at the destination from this source over some reasonable time period. Should all the fragments not arrive at the receiving host. each representing 8 bits. then the source host must fragment it. an Ethernet can accept packets up to 1500 bytes long. This leaves two choices for the IP service model: make sure that all IP datagrams are small enough to fit inside one packet on any network technology. there may be a number of options at the end of the header. The last two required fields in the header are the SourceAddr and the DestinationAddr for the packet. This is known as "dotted decimal" notation. Fragmentation and Reassembly One of the problems of providing a uniform host-to-host service model over a heterogeneous collection of networks is that each network technology tends to have its own idea of how large a packet can be. The source address is required to allow recipients to decide if they want to accept the packet and to enable them to reply. a complete IP implementation must handle them all. 75 | P a g e CS6551 COMPUTER NETWORKS . therefore. While options are used fairly rarely. or provide a means by which packets can be fragmented and reassembled when they are too big to go over a given network technology.2. IP addressing methods An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example. Should the transport protocol that sits on top of IP give IP a packet larger than the local MTU. Figure 3. if any bit in the header is corrupted in transit. It should be noted that this type of checksum does not have the same strong error detection properties as a CRC. in the range 0 to 255 (known as octets) separated by decimal points. but it is much easier to calculate in software. Since a corrupted header may contain an error in the destination address—and.31. Then fragmentation will only be necessary if the path to the destination includes a network with a smaller MTU. the reassembling host will be able to recognize those fragments that go together. IP does not attempt to recover from missing fragments. they all carry the same identifier in the Ident field. Finally. A reasonable choice is the MTU of the network to which the host is directly attached.11. while FDDI packets may be 4500 bytes long. The latter is the key to datagram delivery: Every packet contains a full address for its intended destination so that forwarding decisions can be made at each router. Thus. a computer or a router) to the Internet. the checksum will not contain the correct value upon receipt of the packet.the result. may have been misdelivered—it makes sense to discard any packet that fails the checksum. UniCast address is simply a send-to one addressing mode. Class A addresses begin with 0xxx. Multi-Cast is simply a send-to group addressing mode and can never be used as a source address.Figure 3. or 240 to 255 decimal.4: netid and hostid bits Figure 3. Class C addresses begin with 110x. It is possible to determine to which class a given IP address belong to by examining the most significant four bits of the IP address. (b) Class B .5: IP addresses : (a) Class A .4. or 224 to 239 decimal. D and E. The Class of the address and the subnet mask determine which part belongs to the network address and which part belongs to the node address. or 128 to 191 decimal. Class A networks have 7 bits for the network part and 24 bits for the host part. Class D addresses begin with 1110. (c) Class C. one identifying the network and the other identifying the node. or 192 to 223 decimal.2. Class B addresses begin with 10xx. C. Broad-Cast address is simply a send-to all addressing mode and cannot be used as source address.2. Multi-cast and Broad-cast addresses.2. Class E addresses begin with 1111. Uni-cast. The netid and the hostid bytes for all the classes are shown in the Figure 3. B.There can be only 126 ( 0 and 127 are reserved) Class A networks. Every IP address consists of two parts. or 1 to 127 decimal. The class of the IP address determines the default number of bits used for the network identification and host identification within the network. Each of them can accommodate 224 -2 hosts.3: Binary and dotted decimal notation of IP address There are three modes of addressing namely. Class A addresses were designed for large organizations with large number of hosts or routers 76 | P a g e CS6551 COMPUTER NETWORKS . There are 5 different address classes namely A.2. Figure 3. But the IP datagram must be 77 | P a g e CS6551 COMPUTER NETWORKS . Likewise. for example. There is just one block of Class E addresses. At the physical level. To implement these changes. An example of a physical address is the 48-bit MAC address in the Ethernet protocol.Address Resolution Protocol Mapping Logical to Physical Address: ARP Anytime a host or a router has an IP datagram to send to another host or router. packets pass through physical networks to reach these hosts and routers.attached to their network. Class B networks can accommodate 65. which is designed for multicasting. the hosts and routers are recognized by their physical addresses. ARP. The physical address and the logical address are two different identifiers. We need both because a physical network such as Ethernet can have two different protocols at the network layer such as IP and IPX (Novell) at the same time. resulting in a change in its physical address. The logical (IP) address is obtained from the DNS if the sender is the host or it is found in a routing table if the sender is a router. ADDRESS MAPPING An internet is made of a combination of physical networks connected by internetworking devices such as routers. Class C networks have 8 bits for the network part and 21 bits for the host part. resulting in a new physical address. In dynamic mapping each time a machine knows one of the two addresses (logical or physical). 2. Class B networks have 14 bits for the network part and16 bits for the host part. the IP address of another machine but not its physical address can look it up in the table. The hosts and routers are recognized at the network level by their logical (IP) addresses. which is imprinted on the NIC installed in the host or router. In some LANs. This overhead could affect network performance. such as LocalTalk. it has the logical (IP) address of the receiver. This table is stored in each machine on the network.534 hosts. It is called a physical address because it is usually (but not always) implemented in hardware. There is just one block of Class D addresses. Its jurisdiction is a local network. A packet starting from a source host may pass through several different physical networks before finally reaching the destination host. A physical address is a local address. a packet at a network layer such as IP may pass through different physical networks such as Ethernet and LocalTalk (Apple). Class C addresses were designed for small organizations with a small number of hosts or routers attached to their network. A machine could change its NIC. but is not necessarily unique universally. These can be done by using either static or dynamic mapping. This has some limitations because physical addresses may change in the following ways: 1. This means that delivery of a packet to a host or a router requires two levels of addressing: logical and physical. a static mapping table must be updated periodically. A mobile computer can move from one physical network to another. 3. it can use a protocol to find the other one. However. We need to be able to map a logical address to its corresponding physical address and vice versa. It must be unique locally. Each machine that knows. Static mapping involves in the creation of a table that associates a logical address with a physical address. which is designed for use as reserved addresses. the physical address changes every time the computer is turned on. Class C networks can accommodate only 256 hosts. Class B addresses were designed for midsize organizations that may have tens of thousands of hosts or routers attached to their networks. but only the intended recipient recognizes its IP address and sends back an ARP response packet. Every host or router on the network receives and processes the ARP query packet.1).1 a. This means that the sender needs the physical address of the receiver. the system first checks its cache to see if it can find the mapping.56.3.23.3. Packet Format 78 | P a g e CS6551 COMPUTER NETWORKS . but it does not know the physical address of the recipient. This packet is received by every system on the physical network.3.1 b. Before sending an ARP request. The response packet contains the recipient's IP and physical addresses. but only system B will answer it. A system that receives an ARP reply stores the mapping in the cache memory and keeps it for 20 to 30 minutes unless the space in the cache is exhausted. Figure 3.23. The packet is unicast directly to the inquirer by using the physical address received in the query packet. System B sends an ARP reply packet that includes its physical address.encapsulated in a frame to be able to pass through the physical network. as shown in Figure 3.1 ARP operation Cache Memory Using ARP is inefficient if system A needs to broadcast an ARP request for each IP packet it needs to send to system B. System A needs to pass the packet to its data link layer for the actual delivery. Because the sender does not know the physical address of the receiver. It could have broadcast the IP packet itself.23.23. ARP can be useful if the ARP reply is cached (kept in cache memory for a while) because a system normally sends several packets to the same destination.3. Now system A can send all the packets it has for this destination by using the physical address it received. It uses the services of ARP by asking the ARP protocol to send a broadcast ARP request packet to ask for the physical address of a system with an IP address of 141. the query is broadcast over the network (see Figure 3. In Figure 3. the system on the left (A) has a packet that needs to be delivered to another system (B) with IP address 141.56. The host or the router sends an ARP query packet. The packet includes the physical and IP addresses of the sender and the IP address of the receiver. Then we discuss the four cases in which a host or router needs to use ARP. The sender receives the reply message. an ARP packet can be encapsulated in an Ethernet frame. 6. We will see how the sender obtains this shortly. Encapsulation An ARP packet is encapsulated directly into a data link frame. Ethernet is given type 1. Note that the type field indicates that the data carried by the frame are an ARP packet. and the target IP address. First we describe the steps involved. the value of this field for the IPv4 protocol is 080016. IP asks ARP to create an ARP request message.Figure 3. The target machine replies with an ARP reply message that contains its physical address. The target physical address field is filled with Os. ARP can be used with any higher-level protocol. This field specifies whether this is a request or a response. Operation Let us see how ARP functions on a typical internet. The Source and Target hardware(Ethernet) and protocol(IP) addresses. The target machine recognizes its IP address. The sender knows the IP address of the target. filling in the sender physical address. The fields are as follows: Hardware type : This is a 16-bit field defining the type of the network on which ARP is running. all stations remove the message and pass it to ARP. Protocol type : This is a 16-bit field defining the protocol. 4. The message is unicast. The message is passed to the data link layer where it is encapsulated in a frame by using the physical address of the sender as the source address and the physical broadcast address as the destination address. These are the steps involved in an ARP process: 1. 3. ARP can be used on any physical network. Operation.2 shows the format of an ARP packet for mapping IP address into Ethernet addresses. Because the frame contains a broadcast destination address. For example. Each LAN has been assigned an integer based on its type. 5. For example. It now knows the physical address of the target machine. For example. All machines except the one targeted drop the packet. HLen(“ hardware” address length ) and PLen(“ protocol” address length ): These fields specify the length of the link-layer address and higher-layer protocol address respectively. 2. 79 | P a g e CS6551 COMPUTER NETWORKS . the sender IP address.3. Every host or router receives the frame. 2. Each host or router is assigned one or more logical (IP) addresses. It can then use the physical address to get the logical address by using the RARP protocol. Protocols like BOOTP and DHCP. it needs to assign a RARP server for each network or subnet. There is a serious problem with RARP: Broadcasting is done at the data link layer. The ROM is installed by the manufacturer. which is unique locally. the server is free to return that address to its pool. all is in the case of Ethernet. it needs to assign IP addresses on demand. which has minimum booting information. The station can find its physical address by checking its interface. it sends the packet to the appropriate host or router. DHCP. are replacing RARP. the responding machine must be running a RARP server program. There are occasions in which a host knows its physical address. That is DHCP allows addresses to be ―leased‖ for some period of time. and DHCP . which are unique and independent of the physical (hardware) address of the machine. The machine can get its physical address (by reading its NIC. The station can send its physical address and ask for a short time lease. the router sends an ARP reply announcing its own hardware (physical) address. Another machine on the local network that knows all the IP addresses will respond with a RARP reply. However. The requesting machine must be running a RARP client program. a host or a router needs to know its own IP address or addresses. A RARP request is created and broadcast on the local network. but needs to know its logical address. RARP Reverse Address Resolution Protocol (RARP) finds the logical address for a machine that knows only its physical address. The administrator may put the client and the server on the same network or on different networks . This may happen in two cases: 1. Mapping Physical to Logical Address: RARP.BOOTP messages are encapsulated in a UDP packet. 80 | P a g e CS6551 COMPUTER NETWORKS . This means that if an administrator has several networks or several subnets. for example). is now encapsulated in a frame and is unicast to the destination. and the UDP packet itself is encapsulated in an IP packet. does not pass the boundaries of a network. An organization does not have enough IP addresses to assign to each station. A diskless station is just booted. Whenever a router running a proxy ARP receives an ARP request looking for the IP address of one of these hosts. A proxy ARP is an ARP that acts on behalf of a set of hosts. It cannot include the IP address because the IP addresses on a network are assigned by the network administrator. This is the reason that RARP is almost obsolete. a diskless machine is usually booted from ROM. which carries data for the target machine. BOOTP.7. The physical broadcast address. ProxyARP A technique called proxy ARP is used to create a subnetting effect. To create an IP datagram. BOOTP is an application layer protocol.Dynamic Host Configuration Protocol DHCP dynamically assigns IP addresses to hosts. The IP datagram. but it does not know its IP address. BOOTP The Bootstrap Protocol (BOOTP) is a client/server protocol designed to provide physical address to logical address mapping. Once the lease expires. After the router receives the actual IP packet. The IP address of a machine is usually read from its configuration file stored on a disk file. 255.) In the simplest case.5. a newly booted or attached host sends a DHCPDISCOVER message to a special IP address (255. This means it will be received by all hosts and routers on that network. Thus.255) that is an IP broadcast address. To contact a DHCP server. preventing broadcast to the entire Internet.255. it unicasts it to the DHCP server and awaits the response.1 A DHCP relay agent receives a broadcast DHCPDISCOVER message from a host and sends a unicast DHCPDISCOVER to the DHCP server 81 | P a g e CS6551 COMPUTER NETWORKS . Thus. the first problem faced by DHCP is that of server discovery. which it will then send back to the requesting client. The process of relaying a message from a host to a remote DHCP server is shown in Figure 3.1. (Routers do not forward such packets onto other networks.DHCP relies on the existence of a DHCP server that is responsible for providing configuration information to hosts. it would rather defeat the purpose if each host had to be configured with the address of a DHCP server. When a relay agent receives a DHCPDISCOVER message. The server would then reply to the host that generated the discovery message (all the other nodes would ignore it). it is not really desirable to require one DHCP server on every network because this still creates a potentially large number of servers that need to be correctly and consistently configured. There is at least one relay agent on each network. Since the goal of DHCP is to minimize the amount of manual configuration required for a host to function. one of these nodes is the DHCP server for the network. and it is configured with just one piece of information: the IP address of the DHCP server. DHCP uses the concept of a relay agent. However. Fig 3.5. Fig 3.2 DHCP Packet Format FIELD OCTETS DESCRIPTION ----. see ARP section in "Assigned Numbers" RFC. "generic" name or null in DHCPDISCOVER. null terminated string.5. 2 = BOOTREPLY 1 Hardware address type. 1 = BOOTREQUEST. it is clear that hosts cannot keep addresses indefinitely. 2 Flags (see figure 2). seconds elapsed since client began address acquisition or renewal process. var Optional parameters field. null terminated string. been unplugged from the network. Once the lease expires. 4 'your' (client) IP address. In the case where DHCP dynamically assigns IP addresses to hosts. used by the client and server to associate messages and responses between a client and a server. 1 Hardware address length (e. the server is free to return that 82 | P a g e CS6551 COMPUTER NETWORKS . the client puts its hardware address (e. returned in DHCPOFFER. only filled in if client is in BOUND. RENEW or REBINDING state and can respond to ARP requests. or been turned off. The DHCP server replies by filling in the yiaddr (―your‖ IP address) field and sending it to the client. 64 Optional server host name. '1' = 10mb ethernet.5. optionally used by relay agents when booting via a relay agent. See the options documents for a list of defined options.g.---------------op htype hlen hops xid secs flags ciaddr yiaddr siaddr giaddr chaddr sname file options 1 Message op code / message type. e. Thus. as this would eventually cause the server to exhaust its address pool. 16 Client hardware address. fully qualified directory-path name in DHCPOFFER. At the same time. a random number chosen by the client. 4 Transaction ID. DHCP is derived from an earlier protocol called BOOTP.. 4 IP address of next server to use in bootstrap. Figure 3.2 shows the format of a DHCP message. '6' for 10mb ethernet). 4 Client IP address. DHCP allows addresses to be ―leased‖ for some period of time.g. since it might have crashed. 1 Client sets to zero. DHCPACK by server. a host cannot be depended upon to give back its address.. 2 Filled in by client. its Ethernet address) in the chaddr field.g. 128 Boot file name. When trying to obtain configuration information. The message is actually sent using a protocol called UDP (the User Datagram Protocol) that runs over IP. used in booting via a relay agent. and some of the packet fields are thus not strictly relevant to host configuration. 4 Relay agent IP address. Other information such as the default router to be used by this client can be included in the options field. ICMP also defines a handful of control messages that a router can send back to a source host.2%. and that the TTL had reached 0 that the IP header checksum failed. Note that DHCP may also introduce some more complexity into network management. for an efficiency of only 256/65. the same routing information could be stored in one table entry. 2. we can guarantee an address utilization of at least 50%.39%. and typically much more.(eg) A network with two hosts needs a class C address. known as the Internet Control Message Protocol (ICMP). This is true even if the path to every one of those networks is the same. Classless Routing (CIDR) Classless interdomain routing (CIDR.535 = 0. 83 | P a g e CS6551 COMPUTER NETWORKS . and so on. However. ICMP. called an ICMP-Redirect. One of the most useful control messages. our address assignment efficiency would then be only 16 × 255/65. If a single AS has. For any AS with at least 256 hosts (which means the majority of ASs). tells the source host that there is a better route to the destination. Need for CIDR The second point as mentioned above is the address assignment inefficiency. that means every Internet backbone router needs 16 entries in its routing tables for that AS. Since we would now be handing out address space in chunks of 256 addresses at a time. IP is always configured with a companion protocol. Any AS that requests a class B address will not be given one unless they can show a need for something close to 64K addresses. that the reassembly process failed. and instead give them an appropriate number of class C addresses to cover the expected number of hosts.536 = 6. a network with 256 hosts needs a class B address.Internet Control Message Protocol When a router does not know how to forward the datagram or when one fragment of a datagram fails to arrive at the destination—it does not necessarily fail silently. If we had assigned a class B address to the AS. This solution raises a problem: excessive storage requirements at the routers.78%. A host with a leased address clearly needs to renew the lease periodically if in fact it is still connected to the network and functioning correctly. we could more accurately match the amount of address space consumed to the size of the AS. giving an address assignment efficiency of 2/255 = 0. For example. ICMP defines error messages indicating that the destination host is unreachable (perhaps due to a link failure). The potential for the 32-bit IP address space to be exhausted well before the four-billionth host is attached to the Internet.address to its pool. 16 class C network numbers assigned to it. ICMP defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully. say. since it makes the binding between physical hosts and IP addresses much more dynamic. The growth of backbone routing tables as more and more network numbers need to be stored in them. pronounced ―cider‖) is a technique that addresses two scaling concerns in the Internet: 1. On the other hand.5 clearly matches both prefixes. which means that it must understand that a network number may be of any length is required.5 would match 171.69.bit network prefixes. CIDR helps to aggregate routes. we might find both 171. provider a corporation is attached to before assigning it an address if this scheme is to work. The network numbers that are carried in such a routing protocol are represented simply by (length.20. One way to accomplish that is to assign a portion of address space to the provider and then to let the network provider assign addresses from that space to its customers.10 Route aggregation with CIDR. We now require a routing protocol that can deal with these ―classless‖ addresses. The two corporations served by the provider network have been assigned adjacent 20.10. a packet destined to 171. In general.CIDR. a packet destined to. where the length gives the number of bits in the network prefix—20 in the above example. Observe that the top 20 bits of all the addresses in this range are the same (11000000 00000100 0001). Consider the example in Figure 3. Furthermore. 171. say. that is.To do this.4. we can hand out a block of contiguous class C addresses. therefore. Instead of handing out 16 addresses at random. Example 84 | P a g e CS6551 COMPUTER NETWORKS . Suppose we assign the class C network numbers from 192. (That is. it uses a single entry in a forwarding table to tell us how to reach a lot of different networks) Consider our hypothetical AS with 16 class C network numbers.10 in this example. tries to balance the desire to minimize the number of routes that a router needs to know .31. it is sometimes possible to have prefixes in the forwarding table that ―overlap. IP Forwarding Revisited CIDR means that prefixes may be of any length.‖ in the sense that some addresses may match more than one prefix. Since both of the corporations are reachable through the same provider network.69. from 2 to 32 bits.10. it is possible to aggregate routes repeatedly if addresses are assigned carefully.10. This means that we need to pay attention to which Figure 3. it can advertise a single route to both of them by just advertising the common 19-bit prefix they share.10 (a 24-bit prefix) in the forwarding table of a single router.16 through 192. value_ pairs).69 would be the longest match.4.69. the packet matches the longest prefix.69. The rule in this case is based on the principle of ―longest match‖.69 and not 171. For example.69 (a 16-bit prefix) and 171. and in the absence of any other matching entry in the routing table. In this case. which would be 171. 171.69. 85 | P a g e CS6551 COMPUTER NETWORKS .0.17.4.200.00010001.0. o Example:6. not really a network. test and use network programs without the network. o Example:156.0.0.We want to describe IP addresses whose binary representation starts with 10011100.4.0010 First IP address from the range: 10011100. 208. assume subnet mask/24(B classnetwork).33/32= range consisting of one IPaddress = single computer.130.00100000=156. assume subnet mask/16(B class network). it will be interpreted as10.0. assume subnet mask /8(A class network).0.4. o Example:200.0/8 Interface lo (loopback) By connecting with any computer from this network (usually with127.32 and 156.17. If you assign address 10.0/11 Note: 208.29.128.17.4. Application: it is possible to write.0/24 Network 127.17.200.0/16 If the first IP bits are 110.0.32/28 denotes all the addresses between 156.00000100. you connect with yourself.0.32/28 CIDR used mostly for describing single networks 156.00010001.4.00000100.1 to a network card. Remaining ones can be assigned to computers CIDR allows creating hierarchies of networks and subnetworks Note: Top block received directly from IANA.0.0.0/8 If the first IP bits are 10.1).47 First address in the network is reserved (network address) Last address is also reserved: broadcast address.17.0.0.32 Prefix length = 28 Description =156.17.1/8 Why? Reason stems from pre-CIDR IP classes If the first IP bit is 0. such as the Ethernet address of the next hop. Network as a Graph Figure 3. The nodes of the graph.1 shows a graph representing a network. It generally contains mappings from network numbers to next hops. may be either hosts.0/16 (256 C class networks) If computers with private IP addresses want to communicate with the outside world. Ranges: 10. Multicast – addresses – multicast routing (DVMRP. labeled A through F.0. The routing table is the table that is built up by the routing algorithms as a precursor to building the forwarding table. 172. looking at its destination address.168. metrics) – Switch basics – Global Internet (Areas.1 Example rows from (a) routing and (b) forwarding tables. consulting a table.0. PIM) Routing Difference between forwarding and routing. 192. BGP. routers. Each edge has an associated cost.8. The forwarding table is used when a packet is being forwarded and so must contain enough information to accomplish the forwarding function. Let us assume that the nodes are routers.0. The edges of the graph correspond to the network links. 86 | P a g e CS6551 COMPUTER NETWORKS . which gives some indication of the desirability of sending traffic over that link. This means that a row in the forwarding table contains the mapping from a network number to an outgoing interface and some MAC information.ROUTING Routing (RIP. Table 3. and sending the packet in a direction determined by that table. OSPF. Can be used in local networks (same addresses in different networks).0/8 (one A class network). Routing is the process by which forwarding tables are built.16. the connecting router has to perform Network Address Translation(NAT).0. UNIT III . switches. IPv6).8.0/12 (16 B class networks).Reserved ranges of IP addresses Packet with such addresses should not be passed through routers. Forwarding consists of taking a packet. or networks. 8. 2. Need for a routing algorithm The basic problem of routing is to find the lowest-cost path between any two nodes. In this network. Each node constructs a one-dimensional array (a vector) containing the ―distances‖ (costs) to all other nodes and distributes that vector to its immediate neighbors.8.8.Figure 3. ■ It implies that edge costs cannot change. ■ It does not consider the addition of new nodes or links. Each node knows the cost of the link to each of its directly connected neighbors. dynamic way to solve the problem of finding the lowestcost path in the presence of link and node failures and changing edge costs. Distance vector routing. Figure 3.2 Distance-vector routing: an example network. 87 | P a g e CS6551 COMPUTER NETWORKS . We can represent each node‘s knowledge about the distances to all other nodes as follows. For a simple network like the one in Figure 3. 3.1.2 Distance Vector (RIP) 1. you could imagine just calculating all the shortest paths and loading them into some nonvolatile storage on each node. 3.8. where the cost of a path equals the sum of the costs of all the edges that make up the path. 2. Such a static approach has several shortcomings: ■ It does not deal with node or link failures. Link state routing. Routing Protocol These protocols provide a distributed. Two main classes of routing protocols: 1.1 Network represented as a graph. the cost of each link is set to 1. A link that is down is assigned an infinite cost. A can update its routing table with costs and next hops for allnodes in the network.2(a) Initial distances stored at each node (global view).2(b) Initial routing table at node A. At this point. node F tells node A that it can reach node G at a cost of 1. so it adds these costs to get the cost of reaching G by means of F. Initially. A learns from C that B can be reached from C at a cost of 1.8. Table 3. then.8.2(c). Thus. A learns from C that D can be reached from C at a cost of 1. it adds this to the cost of reaching C (1) and decides that D can be reached via C at a cost of 2. A also knows it can reach F at a cost of 1.8. Initially.8. At the same time. 88 | P a g e CS6551 COMPUTER NETWORKS . Table 3. The routing table stored at A reflects this set of beliefs and includes the name of the next hop that A would use to reach any reachable node.2.2(c) Final routing table at node A.8. Table 3.(a) has a list of distances from one node to all other nodes. For example. A‘s routing table would look like Table 3. so A records that it can reach G at a cost of 2 by going through F. Since this is worse than the current cost of reaching B (1).Table 3.2(b). The next step in distance-vector routing is that every node sends a message to its directly connected neighbors containing its personal list of distances.8. Similarly. which is better than the old cost of infinity. this new information is ignored. A initially believes that it can reach B in one hop and that D is unreachable. each node sets a cost of 1 to its directly connected neighbors and ∞ to all other nodes. The result is shown in Table 3. This total cost of 2 is less than the current cost of infinity. so it concludes that the cost of reaching B via C is 2. For example.Table 3. In an internetwork.2(d) Final distances stored at each node (global view). router C would advertise to router A the fact that it can reach networks 2 and 3 (to which it is directly connected) at a cost of 0. The RIP packet format in Figure 3. and network 4 at cost 2. networks 5 and 6 at cost 1.3(a).3(a) Example network running RIP. It is also extremely simple. in Figure 3.8.8. Figure 3. Routing Information Protocol (RIP) One of the most widely used routing protocols in IP networks is the Routing Information Protocol (RIP). Figure 3.8. the goal of the routers is to learn how to forward packets to various networks.8.8. 89 | P a g e CS6551 COMPUTER NETWORKS . RIP is the canonical example of a routing protocol built on the distance-vector algorithm.3(b).3(b) RIP packet format. How does flooding work? Figure 3. Reliable Flooding Reliable flooding is the process of making sure that all the nodes participating in the routing protocol get a copy of the link-state information from all the other nodes. 3 and 4 are used to make the process of flooding the packet to all nodes reliable. 1 and 2 enable route calculation. we want to provide each node with enough information to enable it to find the least-cost path to any destination. then every node will have enough knowledge of the network to build a complete map of the network.4 Flooding of link-state packets. (c) A and C flood LSP to B (but not X). (a) LSP arrives at node X. This process continues until the information has reached all the nodes in the network. Link State Packet(LSP) Each node creates an update packet. Link-state routing protocols rely on two mechanisms: 1. with each node that receives this information forwarding it out on all of its links. Again. 1. The basic idea of link-state protocols . with the cost of the link to each one 3. Every node knows how to reach its directly connected neighbors. A node sends its link-state information out on all of its directly connected links. A sequence number 4. A time to live for this packet. 2.Link State (OSPF) Each node is assumed to be capable of finding out the state of the link to its neighbors (up or down) and the cost of each link. Calculation of routes from the sum of all the accumulated link-state knowledge.8. that contains the following information: 1. 90 | P a g e CS6551 COMPUTER NETWORKS . Reliable dissemination of link-state information 2. (d) flooding is complete. A list of directly connected neighbors of that node. The ID of the node that created the LSP 2. also called a link-state packet (LSP). Make sure that the totality of this knowledge is disseminated to every node. (b) X floods LSP to A and C. it increments the sequence number by 1. Goal of link-state routing The newest information must be flooded to all nodes as quickly as possible. Since X passes the LSP on to all its neighbors. If the node was down for a long time. Let s ∈ N denote this node. who then turn around and do the same thing. j ) = ∞ if no edge connects i and j . It also ―ages‖ the LSP while it is stored in the node. Use of time to live This is used to ensure that old link-state information is eventually removed from the network. If a node goes down and then comes back up. that is. When a periodic timer expires. replacing the old one. j ) denote the nonnegative cost (weight) associated with the edge between nodes i. The algorithm maintains the following two variables: 91 | P a g e CS6551 COMPUTER NETWORKS . it compares the sequence numbers. and that LSP is stored. Algorithm for Route Calculation Let N denote the set of nodes in the graph. Use of sequence numbers To make sure that old information is replaced by newer information. Note that Y may be any other router in the same routing domain as X. Let l(i. If it already has a copy. X checks to see if it has already stored a copy of an LSP from Y. X then sends a copy of that LSP to all of its neighbors except the neighbor from which the LSP was just received. it starts with a sequence number of 0. it is assumed to be the more recent. the node executing the algorithm to find the shortest path to all the other nodes in N. When are LSPs generated(created)? 1. A smaller (or equal) sequence number would imply an LSP older (or not newer) than the one stored. which is interpreted by all the nodes in the network as a signal to delete that LSP. Let l(i. 2. the node refloods the LSP with a TTL of 0. There is a change in topology . In the following description. When the TTL reaches 0. A node always decrements the TTL of a newly received LSP before flooding it to its neighbors. LSPs carry sequence numbers. j ∈ N. it stores the LSP.Consider a node X that receives a copy of an LSP that originated at some other node Y. If not. all the old LSPs for that node will have timed out . The old information must be removed from the network and not allowed to circulate. The fact that the LSP is not sent back to the node from which it was received helps to bring an end to the flooding of an LSP. if the new LSP has a larger sequence number. the most recent copy of the LSP eventually reaches all nodes. so it would be discarded and no further action would be needed. Each time a node generates a new LSP. If the received LSP was the newer one. where NextHop is the direction I go to reach Next. For the node just added to the Confirmed list in the previous step. and return to step 2. C(w) + l(w. (a) If Neighbor is currently on neither the Confirmed nor the Tentative list. If the Tentative list is empty.1 Link-state routing: an example network. 2.4. Initialize the Confirmed list with an entry for myself. and the Cost is less than the currently listed cost for Neighbor. where NextHop is the direction I go to reach Next. n)) The algorithm works as follows: 1. (b) If Neighbor is currently on the Tentative list.8.Let M denote the set of nodes incorporated so far by the algorithm Let C(n) denote the cost of the path from s to each node n. Otherwise. For each neighbor (Neighbor) of Next. 4. this entry has a cost of 0. 92 | P a g e CS6551 COMPUTER NETWORKS . n) while (N _= M) M = M ∪ {w} such that C(w) is the minimum for all w in (N− M) for each n in (N− M) C(n) = MIN(C(n). stop. NextHop). call it node Next. calculate the cost (Cost) to reach this Neighbor as the sum of the cost from myself to Next and from Next to Neighbor. Cost. move it to the Confirmed list. 3. The algorithm is defined as follows: M = {s} for each n in N− {s} C(n) = l(s. NextHop) to the Tentative list. Cost. then replace the current entry with (Neighbor. select its LSP. Figure 3. then add (Neighbor. pick the entry from the Tentative list with the lowest cost. Difference between the distance-vector and link-state algorithms. It has been proven to stabilize quickly.8.4. but it tells them everything it has learned (i.4.8.1 Steps for building routing table for node D (Figure 3.1).e. It does not generate much traffic. distance to all nodes). each node talks only to its directly connected neighbors. In link state. 1. Properties of the link-state routing algorithm.. 3. but it tells them only what it knows for sure (i.. each node talks to all other nodes.Table 3. In distance vector. 2. only the state of its directly connected links). The Open Shortest Path First Protocol (OSPF) Features of OSPF 93 | P a g e CS6551 COMPUTER NETWORKS . It responds rapidly to topology changes or node failures.e. a satellite link with 250-ms latency looks just as attractive to the routing protocol as a terrestrial link with 1-ms latency. The SourceAddr identifies the sender of the message The AreaId is a 32-bit identifier of the area in which the node is located.5(b) OSPF link-state advertisement. or 2. One example that we have seen already. which is quite reasonable and very simple. The Version field is currently set to 2. In this section.8. are known when we execute the routing algorithm.We provide a few details of the LSA in Figure 3. Finally. however. Second. otherwise it may be 1. METRICS The preceding discussion assumes that link costs. The basic building block of link-state messages in OSPF is known as the link-state advertisement (LSA). it does not distinguish between routes on a capacity basis. 2. Such an approach has several drawbacks. it does not distinguish between links on a latency basis. Additional hierarchy.Authentication of routing messages. Like any internetwork routing protocol.8. First. is protected by a 16-bit checksum The Authentication type is 0 if no authentication is used. or metrics.5 (a) OSPF header format. it does not distinguish between links based on their current load. which indicates that a cryptographic authentication checksum. OSPF must provide information about how to reach networks.8.5(b). we look at some ways to calculate link costs that have proven effective in practice. Figure 3.6-Kbps link look just as good as a 45Mbps link. implying a simple password is used. 1. is to assign a cost of 1 to all links—the least-cost route will then be the one with the fewest hops. The entire packet. Load balancing. Figure 3. making it 94 | P a g e CS6551 COMPUTER NETWORKS . except the authentication data. The Type field may take the values 1 through 5. One message may contain many LSAs. making a 9. Thus. A high-speed satellite link is more attractive than a low-speed terrestrial link. • Broadcast frames to all connected devices on the network. as a measure of load. 95 | P a g e CS6551 COMPUTER NETWORKS . (It was also the place where the superior stability of link-state over distance-vector routing was demonstrated. In this case. rather than just queue length. Stated more precisely. This was done as follows. meaning that a link with 10 packets queued waiting to be transmitted was assigned a larger cost weight than a link with 5 packets queued for transmission.) The following discussion traces the evolution of the ARPANET routing metric and. DepartTime – ArrivalTime represents the amount of time the packet was delayed (queued) in the node due to load. A highly loaded link never shows a cost of more than three times its cost when idle. but instead the packet timed out. Notice that in this case. then DepartTime was reset to the time the packet was retransmitted. explores the subtle aspects of the problem. in so doing. the weight assigned to each link was derived from the average delay experienced by the packets recently sent over that link. respectively. First. SWITCH BASICS • Switches create a virtual circuit between two connected devices. its departure time from the router (DepartTime) was also recorded. each incoming packet was timestamped with its time of arrival at the router (ArrivalTime). however. The most expensive link is only seven times the cost of the least expensive. The original ARPANET routing metric measured the number of packets that were queued waiting to be transmitted on each link.impossible to route around overloaded links. sometimes called the ―new routing mechanism. A second version of the ARPANET routing algorithm. simultaneous virtual circuit connections. the original ARPANET routing mechanism suffered from the fact that it did not take either the bandwidth or the latency of the link into consideration. and the more we want to avoid it. It turns out that this last problem is the hardest because you are trying to capture the complex and dynamic characteristics of a link in a single scalar cost. • Switches on the network provide microsegmentation. when the link-level ACK was received from the other side. DepartTime − ArrivalTime captures the reliability of the link—the more frequent the retransmission of packets. Using queue length as a routing metric did not work well. the original mechanism used distance vector while the later version used link state. the less reliable the link. a situation all too familiar to those of us who hop from line to line at the grocery store. Finally. Second. • This allows maximum utilization of the available bandwidth.‖ took both link bandwidth and latency into consideration and used delay. since queue length is an artificial measure of load—it moves packets toward the shortest queue rather than toward the destination. • A switch is also able to facilitate multiple. the node computed the delay for that packet as Delay = (DepartTime− ArrivalTime) +TransmissionTime +Latency Where Transmission Time and Latency were statically defined for the link and captured the link‘s bandwidth and latency. If the ACK did not arrive. Cost is a function of link utilization only at moderate to high loads. The ARPANET was the testing ground for a number of different approaches to link-cost calculation. establishing a dedicated ommunication path between two devices. – There may be times when packets are relayed with errors. – CRC Check done • Cut-through – The frame is forwarded through the switch before the entire frame is received. 96 | P a g e CS6551 COMPUTER NETWORKS . otherwise depends on the model of the switch. – Fast-forward switching immediately forwards a packet after reading the destination address.Two switching methods • Store-and-forward – The entire frame is received before any forwarding takes place. Cut-through • Fast-forward – Offers the lowest level of latency. • 1900 and 2800 series switches this is configurable. but also reduces error detection. – This mode decreases the latency of the transmission. – The destination and source addresses are read and filters are applied before the frame is forwarded. – Although this occurs infrequently and the destination network adapter will discard the faulty packet upon receipt. • Fragment-free – Fragment-free switching filters out collision fragments before forwarding begins. collision fragments must be smaller than 64 bytes. • Adaptive cut-through – In this mode. We say ―somewhat‖ scalable because even though each router does not need 97 | P a g e CS6551 COMPUTER NETWORKS . – Anything greater than 64 bytes is a valid packet and is usually received without error. – Fragment-free switching waits until the packet is determined not to be a collision fragment before forwarding. Functions of a switch • The main features of Ethernet switches are: – Isolate traffic among segments – Achieve greater amount of bandwidth per user by creating smaller collision domains GLOBAL INTERNET We have seen how to connect a heterogeneous collection of networks to create an internetwork and how to use the simple hierarchy of the IP address to make routing in an internet somewhat scalable. the switch changes to store-and-forward mode. – Once the error threshold is reached. the switch uses cut-through until it detects a given number of errors. – Collision fragments are the majority of packet errors. – In a properly functioning network. but instead it takes on a shape that reflects the fact that it interconnects many different organizations. need to know about all the networks connected to the internet. making sure that The IP address space does not get consumed too quickly. The regional networks were. The tree structure of the Internet in 1990 AREAS An area is a set of routers that are administratively configured to exchange link-state information with each other.g. This section looks at a variety of techniques that greatly improve scalability and that have enabled the Internet to grow as far as it has. DS-3 or OC-3 links) that connect to routers. which are referred to as AS border routers for clarity. it does. 98 | P a g e CS6551 COMPUTER NETWORKS . and thus develop a complete. it will know nothing about the detailed topology of areas other than its own. router R4 in area 3 will never see a link-state advertisement from router R8 in area 1. They are also members of at least one no backbone area. In fact. As a consequence. in turn. in the model described so far. we need to have a general picture in our heads of what the global Internet looks like. Routing protocols such as those we have just discussed do not scale to those kinds of numbers. similarly. The fact that the Internet has a discernible structure can be used to our advantage as we tackle the problem of scalability. It is not just a random interconnection of Ethernets. This has the effect of making the flooding and route calculation processes considerably more scalable. R1 is actually a member of both area 1 and area 2. Today‘s Internet has tens of thousands of networks connected to it. we need to deal with two related scaling issues. However. Note that these are distinct from the routers that are at the edge of an AS. connected by a nationwide backbone. but instead consists of multiple physical networks connected by routers and bridges. the link-state advertisements of routers those are not area border routers do not leave the area in which they originated. it is quite likely that different providers will have different ideas about the best routing protocol to use within their network. An example of a routing domain divided into areas is shown in Figure . each provider‘s network is usually a single autonomous system (AS).to know about all the hosts connected to the internet. Routers R1. Because of this independence. consistent map of the area. The first is the scalability of routing. The second is address utilization that is. also known as area 0. For example.. All the routers in the area send link-state advertisements to each other. There is one special area—the backbone area. Before getting to these techniques. Although the detail is not shown in this figure. In 1990 this backbone was funded by the National Science Foundation (NSF) and was therefore called the NSFNET backbone. each end user site is typically not a single network. R2. and R3 are members of the backbone area. A router that is a member of both the backbone area and a nonbackbone area is an area border router (ABR). We need to find ways to minimize the number of network numbers that get carried around in routing protocols and stored in the routing tables of routers. and on how metrics should be assigned to links in their network. For example. the provider networks are typically built from a large number of pointtopoint links (e. The route from sending node to mobile node can be significantly suboptimal. One of the most extreme examples is when a mobile node and the sending node are on the same network, but the home network for the mobile node is on the far side of the Internet. The sending node addresses all packets to the home network; they traverse the Internet to reach the home agent, which then tunnels them back across the Internet to reach the foreign agent. Clearly it would be nice if the sending node could find out that the mobile node is actually on the same network and deliver the packet directly. In the more general case, the goal is to deliver packets as directly as possible from sending node to mobile node without passing through a home agent. This is sometimes referred to as the triangle routing problem since the path from sender to mobile node via home agent takes two sides of a triangle, rather than the third side that is the direct path. The basic idea behind the solution to triangle routing is to let the sending node know the care-of address of the mobile node. The sending node can then create its own tunnel to the foreign agent. This is treated as an optimization of the process just described. If the sender has been equipped with the necessary software to learn the care of address and create its own tunnel, then the route can be optimized; if not, packets just follow the suboptimal route. Mobile routing provides some interesting security challenges. For example, an attacker wishing to intercept the packets destined to some other node in an internetwork could contact the home agent for that node and announce itself as the new foreign agent for the node. Thus, it is clear that some authentication mechanisms are required. When a home agent sees a packet destined for one of the mobile nodes that it supports, it can deduce that the sender is not using the optimal route. Therefore, it sends a binding update message back to the source, in addition to forwarding the data packet to the foreign agent. The source, if capable, uses this binding update to create an entry in a binding cache, which consists of a list of mappings from mobile node addresses to care-of addresses. The next time this source has a data packet to send to that mobile node, it will find the binding in the cache and can tunnel the packet directly to the foreign agent. UNIT IV TRANSPORT LAYER Overview of Transport layer - UDP - Reliable byte stream (TCP) - Connection management - Flow control - Retransmission – TCP Congestion control - Congestion avoidance (DECbit, RED) – QoS – Application requirements Transport Layer Introduction The following are some of the common properties that a transport protocol can be expected to provide: guarantees message delivery delivers messages in the same order they are sent delivers at most one copy of each message supports arbitrarily large messages supports synchronization between the sender and the receiver allows the receiver to apply flow control to the sender supports multiple application processes on each host 99 | P a g e CS6551 COMPUTER NETWORKS 5 Some of the more typical limitations of the network are that it may drop messages reorder messages deliver duplicate copies of a given message limit messages to some finite size deliver messages after an arbitrarily long delay The transport protocols provide the following services a simple asynchronous demultiplexing service (UDP ) a reliable byte-stream service (TCP) a request/reply service. (RPC) End-to-End Protocols 4.1 Simple Demultiplexer (UDP) The simplest possible transport protocol is one that extends the host-to-host delivery service of the underlying network into a process-to-process communication service. Demultiplexing is allowing multiple application processes on each host to share the network. The Internet‘s User Datagram Protocol (UDP) is an example of such a transport protocol. How does UDP identify the target process? The common approach, and the one used by UDP, is for processes to indirectly identify each other using an abstract locator, often called a port or mailbox. The basic idea is for a source process to send a message to a port and for the destination process to receive the message from a port. The header for an end-to-end protocol that implements this demultiplexing function typically contains an identifier (port) for both the sender (source) and the receiver (destination) of the message. Figure 4.1.1 Format for UDP Header How does a process learns the port for the process to which it wants to send a message? A client process initiates a message exchange with a server process. Once a client has contacted a server, the server knows the client‘s port (it was contained in the message header) and can reply to it. How does the client learn the server‟s port in the first place? 100 | P a g e CS6551 COMPUTER NETWORKS A common approach is for the server to accept messages at a well-known port. That is, each server receives its messages at some fixed port that is widely published. For example, the Domain Name Server (DNS) receives messages at well-known port 53 on each host, the mail service listens for messages at port 25, and the Unix talk program accepts essages at well-known port 517, and so on. An alternative strategy is to use only a single well-known port—the one at which the “Port Mapper” service accepts messages. A client would send a message to the Port Mapper‘s well-known port asking for the port it should use to talk to the ―whatever‖ service, and the Port Mapper returns the appropriate port. This strategy makes it easy to change the port associated with different services over time, and for each host to use a different port for the same service. A port is implemented by a message queue, as illustrated in Figure 4.1.2. Figure 4.1.2 UDP message queue When a message arrives, the protocol (e.g., UDP) appends the message to the end of the queue. If the queue is full, the message is discarded. There is no flow-control mechanism that tells the sender to slow down. When an application process wants to receive a message, one is removed from the front of the queue. If the queue is empty, the process blocks until a message becomes available. UDP does not implement flow control or reliable/ordered delivery, UDP ensures the correctness of the message by the use of a checksum. UDP computes its checksum over the UDP header, the contents of the message body, and something called the pseudoheader. The pseudoheader consists of three fields from the IP header 1. protocol number 2. source IP address 3. destination IP address + the UDP length field. 101 | P a g e CS6551 COMPUTER NETWORKS The pseudoheader is to verify that this message has been delivered between the correct two endpoints. 4.2 Reliable Byte Stream (TCP) The Internet‘s Transmission Control Protocol (TCP) is probably the most widely used transport protocol TCP guarantees the reliable, in-order delivery of a stream of bytes. It is a full-duplex protocol, meaning that each TCP connection supports a pair of byte streams, one flowing in each direction. It also includes a flow-control mechanism for each of these byte streams that allows the receiver to limit how much data the sender can transmit at a given time. Finally, like UDP, TCP supports a demultiplexing mechanism that allows multiple application programs on any given host to simultaneously carry on a conversation with their peers. End-to-End Issues At the heart of TCP is the sliding window algorithm. Even though this is the same basic algorithm because TCP runs over the Internet rather than a point-to-point link, there are many important differences. The sliding window algorithm we already learnt runs over a single physical link that always connects the same two computers. TCP supports logical connections between processes that are running on any two computers in the Internet. This means that TCP needs an explicit connection establishment phase during which the two sides of the connection agree to exchange data with each other. T A single physical link that always connects the same two computers has a fixed RTT, TCP connections are likely to have widely different round-trip times. Variations in the RTT are even possible during a single TCP connection that lasts only a few minutes. What this means to the sliding window algorithm is that the timeout mechanism that triggers retransmissions must be adaptive Packets may be reordered as they cross the Internet, but this is not possible on a point-topoint link where the first packet put into one end of the link must be the first to appear at the other end. Packets that are slightly out of order do not cause a problem since the sliding window algorithm can reorder packets correctly using the sequence number. The real issue is how far out-of-order packets can get, or said another way, how late a packet can arrive at the destination. TCP also implements a highly tuned flow control and congestion-control mechanisms. Flow control involves preventing senders from overrunning the capacity of receivers. Congestion control involves preventing too much data from being injected into the network, thereby causing switches or links to become overloaded. Thus, flow control is an end-to-end issue, while congestion control is concerned with how hosts and networks interact. 102 | P a g e CS6551 COMPUTER NETWORKS Figure 4.2.1 How TCP manages a byte stream. How TCP manages a byte stream? TCP is a byte-oriented protocol, which means that the sender writes bytes into a TCP connection and the receiver reads bytes out of the TCP connection. TCP on the source host buffers enough bytes from the sending process to fill a reasonably sized packet and then sends this packet to its peer on the destination host. TCP on the destination host then empties the contents of the packet into a receive buffer, and the receiving process reads from this buffer at its leisure. This situation is illustrated in Figure 4.2.1, which, for simplicity, shows data flowing in only one direction. A single TCP connection supports byte streams flowing in both directions. The packets exchanged between TCP peers are called segments since each one carries a segment of the byte stream. TCP Segment Format Figure 4.2.3 TCP header format. Each TCP segment contains the header schematically depicted in Figure 4.2.3. The SrcPort and DstPort fields identify the source and destination ports, respectively,just as in UDP. The Acknowledgment, SequenceNum, and AdvertisedWindow fields are all involved in TCP‘s sliding window algorithm. Each byte of data has a sequence number; the SequenceNum field contains the sequence number for the first byte of data carried in that segment. 103 | P a g e CS6551 COMPUTER NETWORKS because it received a segment it did not expect to receive—and so wants to abort the connection. respectively. the two sides engage in an exchange of messages to establish the connection.1 Timeline for three-way handshake algorithm. Figure 4. The possible flags include SYN. The PUSH flag signifies that the sender invoked the push operation. The ACK flag is set any time the Acknowledgment field is valid. The SYN and FIN flags are used when establishing and terminating a TCP connection. the UrgPtr field indicates where the nonurgent data contained in this segment begins. 4.3 TCP Connection Establishment and Termination A TCP connection begins with a client (caller) doing an active open to a server (callee). FIN. The three-way handshake involves the exchange of three messages between the client and the server. it closes one direction of the connection. As soon as a participant is done sending data. Assuming that the server had earlier done a passive open. First. implying that the receiver should pay attention to it. Three-Way Handshake The algorithm used by TCP to establish and terminate a connection is called a three. 104 | P a g e CS6551 COMPUTER NETWORKS . The RESET flag signifies that the receiver has become confused—for example. The URG flag signifies that this segment contains urgent data. as illustrated by the timeline given in Figure 4. When this flag is set. PUSH. which indicates to the receiving side of TCP that it should notify the receiving process of this fact. RESET. The 6-bit Flags field is used to relay control information between TCP peers.way handshake. the client (the active participant) sends a segment to the server (the passive participant) stating the initial sequence number it plans to use (Flags = SYN.3. URG. The Acknowledgment and AdvertisedWindow fields carry information about the flow of data going in the other Direction . SequenceNum = x). and ACK.3. which causes TCP to initiate a round of connection termination messages. Only after this connection establishment phase is over do the two sides begin sending data.1. e. the client responds with a third segment that acknowledges the server‘s sequence number (Flags = ACK. Ack = x + 1) and states its own beginning sequence number (Flags = SYN. if a connection is in the LISTEN state and a SYN segment arrives (i.2. TCP state transition diagram. Everything that goes on while a connection is open—that is.3.3. Ack = y + 1). All connections start in the CLOSED state. Each circle denotes a state that one end of a TCP connection can find itself in. This diagram shows only the states involved in opening a connection (everything above ESTABLISHED) and in closing a connection (everything below ESTABLISHED). The server then responds with a single segment that both acknowledges the client‘s sequence number (Flags = ACK. 105 | P a g e CS6551 COMPUTER NETWORKS .2. both the SYN and ACK bits are set in the Flags field of this second message. a segment with the SYN flag set). Finally.‖ TCP State Transition Diagram TCP state transition diagram is given in Figure 4.3. SequenceNum = y). Thus. That is.. Each arc is labeled with a tag of the form event/action. Now let‘s trace the typical transitions taken through the diagram in Figure 4.2. the operation of the sliding window algorithm—is hidden in the ESTABLISHED state. Figure 4. The reason that each side acknowledges a sequence number that is one larger than the one sent is that the Acknowledgment field actually identifies the ―next sequence number expected. the connection makes a transition to the SYN RCVD state and takes the action of replying with an ACK + SYN segment. This means that at any given time. At some later time. When opening a connection. Observe that TCP on the receive side must keep LastByteRcvd − LastByteRead ≤ MaxRcvBuffer to avoid overflowing its buffer. TCP on the sender side must then adhere to the advertised window it gets from the receiver. The size of the window sets the amount of data that can be sent without waiting for acknowledgment from the receiver. Thus. 4. Both buffers are of some finite size. denoted MaxSendBuffer and MaxRcvBuffer. the client does an active open.4 Adaptive Flow Control Flow control is preventing the sender from overrunning the capacity of the receiver. If only one side closes the connection. It therefore advertises a window size of AdvertisedWindow = MaxRcvBuffer −LastByteRcvd − LastByteRead) which represents the amount of free space remaining in its buffer. Thus. the important thing to keep in mind is that the application process on both sides of the connection must independently close its half of the connection. the receiver throttles the sender by advertising a window that is no larger than the amount of data that it can buffer. the server finally moves to the ESTABLISHED state. but it is still available to receive data from the other side. In other words. ■ Both sides close at the same time: ESTABLISHED → FIN WAIT 1 → CLOSING → TIME WAIT → CLOSED. we have just traced the three-way handshake. Now to the process of terminating a connection. We go back to our sliding window algorithm. When this ACK arrives. the server first invokes a passive open operation on TCP. on any one side there are three combinations of transitions that get a connection from the ESTABLISHED state to the CLOSED state: ■ This side closes first: ESTABLISHED → FIN WAIT 1 → FIN WAIT 2 → TIME WAIT → CLOSED. which causes its end of the connection to send a SYN segment to the server and to move to the SYN SENT state. The arrival of this segment causes the client to move to the ESTABLISHED state and to send an ACK back to the server. ■ The other side closes first: ESTABLISHED → CLOSE WAIT → LAST ACK → CLOSED. then this means it has no more data to send. which causes TCP to move to the LISTEN state. When the SYN segment arrives at the server. it must ensure that LastByteSent − LastByteAcked ≤ AdvertisedWindow The sender computes an effective window that limits how much data it can send: EffectiveWindow = AdvertisedWindow − (LastByteSent − LastByteAcked) 106 | P a g e CS6551 COMPUTER NETWORKS . it moves to the SYN RCVD state and responds with a SYN+ACK segment. 5 Associating the ACK with (a) original transmission versus (b) retransmission. This is the algorithm that was originally described in the TCP specification The idea is to keep a running average of the RTT and then to compute the timeout as a function of this RTT. Specifically.5 Adaptive Retransmission TCP guarantees the reliable delivery of data. As illustrated in Figure 4. while if you assume that the ACK is for the second transmission but it was actually for the first. 107 | P a g e CS6551 COMPUTER NETWORKS . hence it retransmits each segment if an ACK is not received in a certain period of time. that is. α lies between 0. TCP reads the time again and then takes the difference between these two times as a SampleRTT. EstimatedRTT = α × EstimatedRTT + (1 − α) × SampleRTT The parameter α is selected to smooth the EstimatedRTT. The problem was that an ACK does not really acknowledge a transmission. Figure 4.8 and 0. The sender side must also make sure that the local application process does not overflow the send buffer. Since TCP can have a wide variety of RTTs. it uses an adaptive retransmission mechanism. it actually acknowledges the receipt of data. When an ACK for that segment arrives. TimeOut = 2 × EstimatedRTT Karn/Partridge Algorithm A flaw was discovered in the above simple algorithm. TCP sets this timeout as a function of the RTT it expects between the two ends of the connection. it records the time. It is necessary to know which transmission to associate the ACK with so as to compute an accurate SampleRTT. then the SampleRTT is too large (a). every time TCP sends a data segment.9. then the SampleRTT is too small (b) .5. Original Algorithm To compute a timeout value between a pair of hosts. TCP then computes an EstimatedRTT as a weighted average between the previous estimate and this new sample. That is. LastByteWritten − LastByteAcked ≤ MaxSendBuffer 4. if you assume that the ACK is for the original transmission but it was really for the second. TCP is said to be self-clocking. and that it is therefore safe to insert a new packet into the network without adding to the level of congestion. which only adds to the load on the network. The main problem with the original computation is that it does not take the variance of the sample RTTs into account. rather than basing it on the last EstimatedRTT. and although it was an improvement. when the variance is small. it sets the next timeout to be twice the last timeout. it stops taking samples of the RTT. This solution is known as the Karn/Partridge algorithm. Their proposed fix also includes a second small change to TCP‘s timeout mechanism. so that it knows how many packets it can safely have in transit. Whenever TCP retransmits a segment. then the EstimatedRTT can be better trusted. A couple of years later. The solution is simple. TimeOut is close to EstimatedRTT. In the new approach. it uses the arrival of an ACK as a signal that one of its packets has left the network. two other researchers—Jacobson and Karels—proposed a more drastic change to TCP to battle congestion. Intuitively. Karn and Partridge proposed that TCP use exponential backoff. 4. 108 | P a g e CS6551 COMPUTER NETWORKS . it only measures SampleRTT for segments that have been sent only once. the sender measures a new SampleRTT as before.6 TCP Congestion Control The idea of TCP congestion control is for each source to determine how much capacity is available in the network. By using ACKs to pace the transmission of packets. Once a given source has this many packets in transit. Their approach was designed to fix some of the causes of that congestion. Thus. It then folds this new sample into the timeout calculation as follows: Difference = SampleRTT − EstimatedRTT EstimatedRTT = EstimatedRTT + (δ × Difference) Deviation = Deviation + δ(|Difference| − Deviation) where δ is a fraction between 0 and 1. Jacobson/Karels Algorithm The Karn/Partridge algorithm was introduced at a time when the Internet was suffering from high levels of network congestion. if the variation among samples is small. similar to what the Ethernet does. the congestion was not eliminated. Each time TCP retransmits. It should be clear how the timeout mechanism is related to congestion—if you time out too soon. TCP then computes the timeout value as a function of both EstimatedRTT and Deviation as follows: TimeOut = μ × EstimatedRTT + φ × Deviation μ is typically set to 1 and φ is set to 4. you may unnecessarily retransmit a segment. after its inventors. a large variance causes the Deviation term to dominate the calculation. That is. 109 | P a g e CS6551 COMPUTER NETWORKS . Additional losses cause CongestionWindow to be reduced to 4. This halving of the CongestionWindow for each timeout corresponds to the ―multiplicative decrease‖ part of AIMD. For example. Additive Increase/Multiplicative Decrease TCP maintains a new state variable for each connection. Although CongestionWindow is defined in terms of bytes. the maximum segment size (MSS). Effective window is revised as follows: MaxWindow = MIN(CongestionWindow. or in TCP terminology. it is easiest to understand multiplicative decrease if we think in terms of whole packets. How does the source determine that the network is congested and that it should decrease the congestion window? TCP interprets timeouts as a sign of congestion and reduces the rate at which it is transmitting. CongestionWindow is set to 8. then 2. is sent by the receiving side of the connection. We also need to be able to increase the congestion window to take advantage of newly available capacity in the network. The TCP source sets the CongestionWindow based on the level of congestion it perceives to exist in the network. suppose the CongestionWindow is currently set to 16 packets. This mechanism is commonly called additive increase/multiplicative decrease (AIMD). Specifically. the source sets CongestionWindow to half of its previous value.Congestion Control Mechanisms 1. each time a timeout occurs. This is the ―additive increase‖ part of AIMD. each packet sent out during the last RTT has been ACKed—it adds the equivalent of one packet to CongestionWindow. AdvertisedWindow) EffectiveWindow = MaxWindow − (LastByteSent − LastByteAcked). a TCP source is allowed to send no faster than the slowest component—the network or the destination host—can accommodate. and finally to 1 packet. That is. Thus. Congestion Window is used by the source to limit how much data it is allowed to have in transit at a given time. MaxWindow replaces AdvertisedWindow in the calculation of EffectiveWindow. TCP is modified such that the maximum number of bytes of unacknowledged data allowed is now the minimum of the congestion window and the advertised window. CongestionWindow is not allowed to fall below the size of a single packet. This involves decreasing the congestion window when the level of congestion goes up and increasing the congestion window when the level of congestion goes down. The congestion window is congestion control‘s counterpart to flow control‘s advertised window. If a loss is detected. and it works as follows. called CongestionWindow. Every time the source successfully sends a CongestionWindow‘s worth of packets—that is. The AdvertisedWindow. Specifically. 110 | P a g e CS6551 COMPUTER NETWORKS . the congestion window is incremented as follows each time an ACK arrives: Increment = MSS × (MSS/CongestionWindow) CongestionWindow + = Increment Figure 4.6.6.6. This linear increase is illustrated in Figure 4. Slow Start The additive increase mechanism is used when the source is operating close to the available capacity of the network. It takes too long to ramp up a new TCP connection . with one packet being added each RTT. 2.2 Packets in transit during slow start.1.1 Packets in transit during additive increase. Figure 4. the source starts out by setting CongestionWindow to one packet. 3. Figure 4. TCP increments CongestionWindow by 2—one for each ACK—and next sends four packets. which suggests that an earlier packet might have been lost. the receiver responds with an acknowledgment.6. When the ACK for this packet arrives. Specifically.6. Compare this to the linear growth of additive increase illustrated in Figure 4. TCP adds 1 to CongestionWindow and then sends two packets. The idea of fast retransmit is straightforward. Fast Retransmit and Fast Recovery Fast retransmit is a heuristic that sometimes triggers the retransmission of a dropped packet sooner than the regular timeout mechanism. it knows that the other side must have received a packet out of order. Slow start is used to increase the congestion window rapidly from a cold start. The end result is that TCP effectively doubles the number of packets it has in transit every RTT. Every time a data packet arrives at the receiving side. the sender waits until it sees some number of duplicate ACKs and then retransmits the missing packet.6. 111 | P a g e CS6551 COMPUTER NETWORKS . when a packet arrives out of order— that is. Since it is also possible that the earlier packet has only been delayed rather than lost. In practice. Upon receiving the corresponding two ACKs. This second transmission of the same acknowledgment is called a duplicate ACK. TCP cannot yet acknowledge the data the packet contains because earlier data has not yet arrived—TCP resends the same acknowledgment it sent the last time. When the sending side sees a duplicate ACK. The fast retransmit mechanism does not replace regular timeouts. Figure 4. even if this sequence number has already been acknowledged. rather than linearly. Thus. TCP waits until it has seen three duplicate ACKs before retransmitting the packet.1.2 shows the growth in the number of packets in transit during slow start. it just enhances that facility.3 Fast retransmit based on duplicate ACKs. Slow start effectively increases the congestion window exponentially. the receiver then sends a cumulative ACK for everything up to and including packet 6 back to the source. Each router monitors the load it is experiencing and explicitly notifies the end nodes when congestion is about to occur. but packet 3 is lost in the network. This section describes three different congestion-avoidance mechanisms. When the fast retransmit mechanism signals congestion. Thus. again when packet 5 arrives. it is possible to use the ACKs that are still in the pipe to clock the sending of packets. RED and Source-based Congestion Avoidance. which is called fast recovery.3 illustrates how duplicate ACKs lead to a fast retransmit. For example. The first two take a similar approach: They put a small amount of additional functionality into the router to assist the end node in the anticipation of congestion. At all other times. the source adjusts its sending rate so as to avoid congestion. When the sender sees the third duplicate ACK for packet 2—the one sent because the receiver had gotten packet 6—it retransmits packet 3. the destination receives packets 1 and 2.6. Finally. In other words. fast recovery avoids the slow and instead simply cuts the congestion window in half and resumes additive increase. The destination host then copies this congestion bit into the ACK it sends back to the source. Figure 4. 1. DECbit The first mechanism was developed for use on the Digital Network Architecture (DNA). In this example. Note that when the retransmitted copy of packet 3 arrives at the destination. slow start is only used at the beginning of a connection . This notification is implemented by setting a binary congestion bit in the packets that flow through the router. effectively removes the slow start phase that happens between when fast retransmit detects a lost packet and additive increase begins.7 Congestion-Avoidance Mechanisms Congestion Avoidance is to predict when congestion is about to happen and then to reduce the rate at which hosts send data just before packets start being discarded. What happens in the router? 112 | P a g e CS6551 COMPUTER NETWORKS . a connectionless network with a connection-oriented transport protocol. 4. The third mechanism is very different from the first two: It attempts to avoid congestion purely from the end nodes. This mechanism. the destination will send a duplicate ACK for packet 2 when packet 4 arrives. the congestion window is following a pure additive increase/multiplicative decrease pattern. and so on. They are DECbit . RED has two queue length thresholds that trigger certain activity: 113 | P a g e CS6551 COMPUTER NETWORKS .) What does the source do to avoid congestion? The source records how many of its packets resulted in some router setting the congestion bit. A router sets this bit in a packet if its average queue length is greater than or equal to 1 at the time the packet arrives. therefore. The ―increase by 1. A single congestion bit is added to the packet header. The second difference between RED and DECbit is in the details of how RED decides when to drop a packet and what packet it decides to drop. o This idea is called early random drop. and watches to see what fraction of the last window‘s worth of packets resulted in the bit being set. is similar to the DECbit scheme in that each router is programmed to monitor its own queue length. If less than 50% of the packets had the bit set. called random early detection (RED). This average queue length is measured over a time interval that spans the last busy+idle cycle. RED is most commonly implemented such that it implicitly notifies the source of congestion by dropping one of its packets. 2. The first is that rather than explicitly sending a congestion notification message to the source. and when it detects that congestion is imminent.875‖ rule was selected because additive increase/multiplicative decrease makes the mechanism stable. decrease by 0. plus the current busy cycle. effectively notified by the subsequent timeout or duplicate ACK. 1. The source is. Second. (The router is busy when it is transmitting and idle when it is not. If 50%or more of the last window‘s worth of packets had the congestion bit set. RED computes an average queue length .875 times the previous value. Random Early Detection (RED) A second mechanism. then the source increases its congestion window by one packet. The source maintains a congestion window. When to drop a packet and what packet it to drop? o Drop each arriving packet with some drop probability whenever the queue length exceeds some drop level. to notify the source to adjust its congestion window. That is. then the source decreases its congestion window to 0. RED differs from the DECbit scheme in two major ways. o The RED algorithm defines the details of how to monitor the queue length and when to drop a packet. 2. AvgLen is computed as AvgLen = (1 −Weight) × AvgLen +Weight × SampleLen where 0 <Weight < 1 and SampleLen is the length of the queue when a sample measurement is made. just as in TCP. the source increases the window size by one packet and compares the throughput achieved to the throughput when the window was one packet smaller. Algorithm 2: The window is adjusted once every two round-trip delays based on the product (CurrentWindow − OldWindow) ×(CurrentRTT − OldRTT) If the result is positive. there is a measurable increase in the RTT for each successive packet it sends. or more specifically. If the difference is less than one-half the throughput achieved when only one packet was in transit . the source decreases the window size by one-eighth. The throughput is calculated by dividing the number of bytes outstanding in the network by the RTT. If it is. 114 | P a g e CS6551 COMPUTER NETWORKS . Algorithm 3: For every RTT. It compares the measured throughput rate with an expected throughput rate. the source might notice that as packet queues build up in the network‟s routers. For example. When a packet arrives at the gateway. RED compares the current AvgLen with these two thresholds. MinThreshold and MaxThreshold. Algorithm 1: For every two round-trip delays the algorithm checks to see o if the current RTT is greater than the average of the minimum and maximum RTTs seen so far. Source-Based Congestion Avoidance The general idea of these techniques is to watch for some sign from the network that some router‘s queue is building up and that congestion will happen soon if nothing is done about it. then the algorithm decreases the congestion window by one-eighth. then decreases the window by one packet. according to the following rules: if AvgLen ≤ MinThreshold −→ queue the packet if MinThreshold < AvgLen < MaxThreshold −→ calculate probability P −→ drop the arriving packet with probability P if MaxThreshold ≤ AvgLen −→ drop the arriving packet 3. If the result is negative or zero. the source increases the window by one maximum packet size. changes in the sending rate. Algortihm 4: (TCP Vegas) This last algorithm looks at changes in the throughput rate. and data. Let Diff = ExpectedRate−ActualRate. those that combine audio. Note that Diff is positive or 0 by definition. Hence the best-effort model. First. 4. expect to be able to converse in such a way that one person can respond to something said by the other and be heard almost immediately. it decreases the congestion window linearly during the next RTT. BaseRTT = minimum of all measured round-trip times. We can see that the farther away the actual throughput gets from the expected throughput. For example . the more congestion there is in the network. The β threshold triggers this decrease. such a strategy cannot provide timeliness. Timely arrival must be provided by the network itself (the routers). We refer to applications that are sensitive to the timeliness of data as real-time applications. that is. On the other hand. it increases the congestion window linearly during the next RTT When Diff > β. not just at the network edges (the hosts). participants in a telephone conversation. Compare ActualRate to ExpectedRate and adjust the window accordingly. Thus. when the actual throughput rate gets too close to the expected throughput. ActualRate is calculated as ActualRate = Number of bytes transmitted / sample RTT This calculation is done once per round-trip time. the connection is in danger of not utilizing the available bandwidth. 115 | P a g e CS6551 COMPUTER NETWORKS . The α threshold triggers this increase. define a given flow‘s BaseRTT to be the RTT of a packet when the flow is not congested. α < β. packet-switched networks have offered the promise of supporting multimedia applications. We also define two thresholds. The expected throughput is given by ExpectedRate = CongestionWindow/BaseRTT The current sending rate. The distinguishing characteristic of real-time applications is that they need some sort of assurance from the network that data is likely to arrive on time . which implies that the sending rate should be reduced. the timeliness of delivery can be very important. since ActualRate > ExpectedRate implies that we need to change BaseRTT to the latest sampled RTT. There is more to transmitting audio and video over a network than just providing sufficient bandwidth.8 Quality of Service For many years. video. The congestion window is unchanged when α < Diff < β. Whereas a non-real-time application(elastic) can use an end-to-end retransmission strategy to make sure that data arrives correctly. in which the network tries to deliver your data but makes no promises is not sufficient for real-time applications. When Diff < α. then we can set our playback point accordingly. Thus. Taxonomy of Real-Time Applications Figure 4. one lost audio sample can be interpolated from the surrounding samples with relatively little effect on the perceived audio quality(can tolerate loss) whereas a robot control program is likely to be an example of a real-time application that cannot tolerate loss— losing the packet that contains the command instructing the robot arm to stop is unacceptable. Tolerant and Intolerant Real –time Applications The first characteristic by which we can categorize applications is their tolerance of loss of data. If we notice that packets are almost always arriving within 300 ms of being sent. For example. where ―loss‖ might occur because a packet arrived too late to be played back as well as arising from the usual causes in the network. For example.8 1.8 Taxonomy of Applications The taxonomy of applications is summarized in Figure 4. an audio application might be able to adapt to the amount of delay that packets experience as they traverse the network. The network may then respond by providing an assurance that it will do better . CS6551 COMPUTER NETWORKS . What we need is a new service model. This implies that the network will treat some packets differently from others—something that is not done in the best-effort model. A network that can provide these different levels of service is often said to support quality of service (QoS). in which applications that need higher assurances can ask the network for them. we can categorize real-time applications as tolerant or intolerant depending on whether they can tolerate occasional loss. Non-adaptive and Adaptive Real –time Applications 116 | P a g e A second way to characterize real-time applications is by their adaptability. 2. are classified into two broad categories: fine-grained approaches. The IntServ working group developed specifications of a number of service classes designed to meet the needs of some of the application types described above. Suppose that we subsequently observe that all packets are arriving within 100 ms of being sent. many video coding algorithms can trade off bit rate versus quality. 3. Service Classes o One of the service classes is designed for intolerant applications. adaptive applications is known as controlled load . Approaches to QoS Support Some of the approaches that have been developed to provide a range of qualities of service. If more bandwidth becomes available later. Rate Adaptive and Delay Adaptive Real –time Applications We call applications that can adjust their playback point delay-adaptive applications. o We assume that early arrival of packets can always be handled by buffering. o This service is referred to as the guaranteed service. and it has been effectively implemented for several voice applications. Thus. o The application can then set its playback point so that no packet will ever arrive after its playback time. we can change parameters to increase the quality. we can set our coding parameters accordingly. which provide QoS to individual applications or flows coarse-grained approaches. 1. It also defined how RSVP could be used to make reservations using these service classes. then the users of the application would probably perceive an improvement. Another class of adaptive applications are rate adaptive. if we find that the network can support a certain bandwidth. For example. The process of shifting the playback point would actually require us to play out samples at an increased rate for some period of time. playback point adjustment is fairly easy in this case. Thus. 2. o These applications require that a packet never arrive late. which provide QoS to large classes of data or aggregated traffic. Overview of Mechanisms 117 | P a g e CS6551 COMPUTER NETWORKS . o The network should guarantee that the maximum delay that any packet will experience has some specified value. If we moved up our playback point to 100 ms. o The service that meets the needs of tolerant. Integrated Services (RSVP) The term ―Integrated Services‖ (often called IntServ for short) refers to a body of work that was produced by the IETF around 1995–97. You might think that this presents no problem. o The RSpec is very service specific. o It turns out that this information is very helpful to the admission control algorithm when it tries to figure out whether it can accommodate a new request for service. then the total rate at which data arrives at the switch will be greater than 10 Mbps. If enough sources send at above their average rates. o The set of information that we provide to the network is referred to as a flowspec. data sitting in the queue is being delayed. This excess data will be queued before it can be sent on the link. o To send a packet of length n. o I can accumulate no more than B tokens. if 10 users ask for a service in which each will consistently use 2 Mbps of link capacity. and even if it doesn‘t come to that. since a low-bandwidth application is going to require fewer network resources than a high-bandwidth application. o The TSpec is a little more complicated. I need n tokens. If packets are delayed long enough. Such a filter is described by two parameters: a token rate r and a bucket depth B. 118 | P a g e CS6551 COMPUTER NETWORKS . Assume that over some suitably long interval each flow can be expected to send no more than 1 Mbps. o There are two separable parts to the flowspec: o the part that describes the flow‟s traffic characteristics (called the TSpec) o and the part that describes the service requested from the network (the RSpec). We need to give the network enough information about the bandwidth used by the flow to allow intelligent admission control decisions to be made. o To be able to send a byte. o What this means is that I can send a burst of as many as B bytes into the network as fast as I want. but over a sufficiently long interval. The longer this condition persists. b) Admission Control o For example. For Example. Packets might have to be dropped. if these are variable bit rate applications. the service that was requested will not be provided. then they will occasionally send more than their average rates. I must have a token. such as compressed video. o I start with no tokens and I accumulate them at a rate of r per second. I can‘t send more than r bytes per second. the network will have to say no to some of them. and they all share a link with 10-Mbps capacity. One way to describe the bandwidth characteristics of sources is called a token bucket filter. However. It works as follows. Suppose that we have 10 flows that arrive at a switch on separate input ports and that all leave on the same 10-Mbps link. the longer the queue will get.a) Flowspec o We need to tell the network something about what we are going to inject into it. o When some new flow wants to receive a particular level of service. Who sets the premium bit. o The hard part is figuring out when to say yes and when to say no. The Internet service provider mightdo this because that company has paid for a higher level of service than best effort. and admission control decisions have been made. o Admission control is very dependent on the type of requested service and on the queuing discipline employed in the routers.o The process of deciding when to say no is called admission control. the Differentiated Services model (often called DiffServ for short) allocates resources to a small number of classes of traffic. o This last mechanism is packet scheduling. if it‘s a 0. the network switches and routers need to meet the requirements of the flows. This could obviously be done by using a bit in the packet header—if that bit is a 1. the packet is best effort. the packet is a premium packet. Differentiated Services The Integrated Services architecture allocates resources to individual flows. d) Packet Scheduling o Finally. o If it can provide the service. admission control looks at the TSpec and RSpec of the flow and tries to decide if the desired service can be provided to that amount of traffic. c) Resource Reservation o The mechanism by which the users of the network and the components of the network itself exchange information such as requests for service. some proposed approaches to DiffServ simply divide traffic into two classes. when flows and their requirements have been described. o A key part of meeting these requirements is managing the way packets are queued and scheduled for transmission in the switches and routers. which we‘ll call “premium. and under what circumstances? The router at the edge of anInternet service provider‘s network might set the bit for packets arriving on an interface that connects to a particular company‘s network.” Clearly. In fact. we will need some way to figure out which packets are premium and which are regular old best effort. if not. 119 | P a g e CS6551 COMPUTER NETWORKS . o The idea behind admission control is simple. without causing any previously admitted flow to receive worse service than it had requested. and admission control decisions is called resource reservation. the flow is admitted. Suppose that we have decided to enhance the best-effort service model by adding just one new class. then it is denied. o It is achieved using a Resource Reservation Protocol. flowspecs. given the currently available resources. which is used to query the state of remote network nodes.RFC 822 & MIME define the format of email messages.SNMP TRADITIONAL APPLICTAIONS It is important to distinguish between application programs and application protocols. (e.g) internet explorer. IMAP. HTTP:.Simple network management protocol. a term that indicates that they define the behavior of individual routers rather than endto-end services. HTTP:. Application protocol: It is used to retrieve WebPages from remote servers. They are all implemented on top of either TCP or UDP. (e. MIME) – HTTP – Web Services – DNS . These are called “per-hop behaviors”.. which is used ot query name servers and send the responses. All these application protocols follow the same request/reply communication pattern. which is used to communicate between web Browsers and web servers. Each protocol have a companion protocol that specifies the format of the data that can be exchanged except DNS. Much of complexity is managed in this companion document. SNMP:. POP3.g) SMTP:.. safari etc.Domain Name system protocol. netscape.Simple mail Transfer Protocol. 120 | P a g e CS6551 COMPUTER NETWORKS . (PHBs). which is used to exchange electronic mail.Hyper text transfer protocol.HTML is a companion specification that define format of email messages. THE POPULAR APPLICATION PROTOCOLS ARE: SMTP:.g) hypertext transfer protocol(HTTP) Application program: It provides users with a different look and feel but all of them use the same HTTP protocol to communicate with web servers over the internet. firefox. the form of those pages. (e. DNS:. Each protocol reinvents a RPC (Remote procedure call) like mechanism on top of the existing transport protocols. What does a router do differently when it sees a packet with the bit set? The Differentiated Services working group of the IETF is standardizing a set of router behaviors to be applied to marked packets. UNIT V APPLICATION LAYER Traditional applications -Electronic Mail (SMTP. Management information base(MIB) defines the variables that can be quered. ELECTRONIC MAIL (E-MAIL) E-mail is used for sending a message that includes text. it need only two user agents. First scenario When the sender and the receiver of an e-mail are on the same mail server. It specifies how two mail systems interact and the format of control messages they exchange to transfer mail. voice. video or graphics to one or more recipients. Third scenario 121 | P a g e CS6551 COMPUTER NETWORKS . SMTP is an internet standard protocol used for transferring electronic mail messages from one computer to another. Second scenario When the sender and the receiver of an e-mail are on different mail servers. To explain the architecture of e-mail. consider the four scenarios.SNMP:. SMTP is used for E-mail. it need two UAs and a pair of MTAs (client and server). The fourth scenario is the most common in the exchange of e-mail. grammar checking etc. we need two UAs.When the sender is connected to the mail server via a LAN or a WAN. Composing messages: UA provides a template on screen. which provides service to the user to make the process of sending and receiving a message easier. Fourth scenario When both sender and receiver are connected to the mail server via a LAN or a WAN. two pairs of MTAs (client and server). The services provided by the UA are compose messages reading messages replying to messages forwarding messages and Handling mailboxes. User fills the template and edits its with options like spell check. and a pair of MAAs (client and server). USER AGENT(UA): The first component of E-mail system is the user agent. READING MESSAGES: 122 | P a g e CS6551 COMPUTER NETWORKS . This is the most common situation today. change font. it need two UAs and two pairs of MTAs (client and server). g) Microsoft‘s outlook.indicates the status of the mail such as new or already checked. 123 | P a g e CS6551 COMPUTER NETWORKS . command driven 2. A UA allows the receiver to forward the message. It has graphical components like icons. The summary contains • Number field • Flag field:. with or without extra comments to a third party. OUTBOX:.g) r to reply to sender R to reply to all recipients GUI BASED: Modern UA are GUI based which contains graphical user interface (GUI) components that allow the user to interact with the software by using both keyboard and mouse. It has two parts. menu bars. GUI Based command driven: command driven UA accepts a one character command from keyboard and performs its specific task. SENDING MAIL It looks similar to postal mail. They are 1. and windows. FORWADING MESSAGES: Forwarding is defined as sending the message to a third party. (e. Envelope and message.The second duty of the UA is to read the incoming messages.has all received mails till user deletes it. The UA displays a one line summary of each received mail. The reply message may contain the original message and the new message.has all sent mails till user deletes it TYPES OF UA: There are two types of user agents. • Size of the message • sender • optional subject field REPLYING TO MESSAGES: After reading the messages the user can use the UA to reply to the sender or to all recipients. HANDLING MAILBOXES: Two mailboxes created by UA are: Inbox:. (e. Netscape. the subject. The receiver views the summary of several mails and selects one at a time to read the entire content of the mail. FORMAT OF AN EMAIL: Receiving MAIL: The mail from sender reaches the receiver‘s mailbox. (e. DOMAIN PART: Every sender or receiver has registered his mail address in a domain from DNS. Body: contains the information to be read by th recipient.com MESSAGE TRANSFER AGENT: To send and receive a mail there should be a client MTA and server MTA.Envelope: usually contains the sender and the receiver addresses. SMTP server starts then. The receiver checks the mails in his mailbox. Message: contains the header and the body Header: defines the sender.. The mail in receiver inbox is displayed as a summary which contains sender mail address. and the 2 parts are separated by @ sign.client established a TCP connector at PORT no 25. E-mail Address: Addresses: To deliver mail a mail handling system must use an addressing system with unique addresses. LOCAL PART:. 124 | P a g e CS6551 COMPUTER NETWORKS . the time the mail was received or sent by sender.server MTA send responses to client Phases in mail transfer: 1.g) AAA @ gmail. The address consists of two parts: local part and domain part. Client MTA sends commands to server .defines a name of a special file called the user mailbox. Connection Establishment:. receiver and subject of the message. where all the mail received for a user is stored for retrieval by the message UA. Connection termination:. The content type and the content subtype are separated by a slash(eg) <type /subtype:parameter> 3.Message is sent 3. – SMTP servers may reject mail message over a certain size etc. First stage: Mail is sent from UA to local server. Third stage: UA gets the mail.this header defines the version of MIME used.1. 1.all the messages are transferred and then the client terminates the connection.this header uniquely identifies the whole message in a multiple message environment. MIME version:. MIME: MIME defines five headers that can be added to the original e-mail header section to define the transformation parameters.This header defines whether the body is image . MAIL DELIVERY: There are three stages for a mail delivery in between the sending UA and receiving UA. 2. Content-Type:. from remote server using POP3 and IMAP4 protocol.The message at the receiving side is transformed back to the original data. 1. Limitations of the SMTP: – Cannot transmit executable files or other binary objects – Cannot transmit text data that includes national language characters – It cannot be used for languages that are not supported by 7-bit ASCII characters such as French. 5. MIME is intended to resolve these problems MIME(MULTIPURPOSE INTERNET MAIL EXTENSIONS) MIME is a supplementary protocol that allows non ASCII data to be sent through SMTP. 4. MIME transforms non-ASCII data at the sender site to ASCII data and delivers them to the client MTA to be sent through the internet . Content description:. Content Transfer encoding:.audio or video.Defines the method used to encode the messages into 0s and 1sf for transport.2. The current version is 1.This header defines the type of data used in the body of the message. Message transfer:. German etc . 125 | P a g e CS6551 COMPUTER NETWORKS .. second stage: mail goes from local server to remote server 3. Content ID:. 2. a system must have the client MTA. Commands and responses 126 | P a g e CS6551 COMPUTER NETWORKS . SMTP defines how commands and responses must be sent back and forth.Message Transfer Agent:SMTP The actual mail transfer is done through message transfer agents (MTAs). a system must have a server MTA. and to receive mail. Two pairs of MTA clientserver programs are used in the most common situation. To send mail. The formal protocol that defines the MTA client and server in the Internet is called Simple Mail Transfer Protocol (SMTP). SMTP range SMTP is used two times between the sender and the sender‘s mail server and between the two mail servers. A response is a three digit code that may be followed by additional textual information. The format of commands is ― Keyword : argument(s)”. 127 | P a g e CS6551 COMPUTER NETWORKS . Responses: Responses are sent from server to client. Commands: Commands are sending from the client to server. The first five commands are mandatory.Each command and reply is terminated by a two character (carriage return and line feed) end of line token. mail transfer.Mail transfer process: The process of transferring a mail messages occurs in three phases: connection establishment. Connection establishment Message transfer 128 | P a g e CS6551 COMPUTER NETWORKS . connection termination. Pop3 and IMAP4 129 | P a g e CS6551 COMPUTER NETWORKS . It is an PULL protocol. (ie) the client must pull messages from the server.Connectio n termination POP3(POST OFFICE PROTOCOL VERSION 3)& IMAP4(INTERNET MAIL ACCESS PROTOCOL) The two message access protocols are POP3 and IMAp4. POP3 has two modes: 1. Mail access starts with the client when the user needs to download email from the mailbox on the mail server.the ail remains in the mailbox after each retrieval. one by one. 3. IMAP4 IMAP4 provides the following extra functions: A user can check the email header prior to downloading A user can search the contents of the email for a specific string of characters prior to downloading A user can partially downloaded email. The POP3 does not allow the user to partially check the contents of the mail before downloading. A user can create. The exchange of commands and responses in POP3 Drawbacks of POP3: 1. or rename mailboxes on the mail server.POP3: The client POP3 software is installed on the recipient computer. Keep mode:. delete mode:.the mail is deleted from the mailbox after each retrieval 2. The user cannot have different folders on the server. The user can then list and retrieve the mail messages. It does not allow the user to organize her mail on the server. It then sends its user name and password to access the mailbox. HTTP (HYPERTEXT TRANSFER PROTOCOL) 130 | P a g e CS6551 COMPUTER NETWORKS . the server POP3 software is installed on the mail server. delete. A user can create a hierarchy of mailboxes in a folder for e mail messages. The client opens a connection to the server on TCP 110. 2. Request and status line: First line in a request message is called request line & First line in a response message is called status line REQUEST AND STATUS LINE: 131 | P a g e CS6551 COMPUTER NETWORKS . HTTP functions like a combination of FTP and SMTP. but HTTP messages are delivered immediately. the HTTP messages are not destined to be read by humans. HTTP Transaction : Figure illustrates the HTTP transaction between the client and server. they are read and interpreted by the HTTP server and HTTP client (browser). It is similar to FTP because it transfers files and uses the services of TCP. The commands from the client to the server are embedded in a letter like request message. The client initializes the transaction by sending a request message. shown in figure request and response. and sometimes a body. The server replies by sending a response. A client sends a request. The idea of HTTP is very simple. However it is called the hypertext transfer protocol because its efficiency allows its use in a hypertext environment where there are rapid jumps from one document to another. headers. The server sends the response. and sometimes a body. and so on. audio. However. Request Messages: A request message consists of a request line. In addition. which looks like mail. HTTP differs from SMTP in the way the messages are sent from the client to the server and from the server to the client. Both message types follow almost the same format. which looks like a mail reply. The contents of the requested file or other information are embedded in a letter like response message. The request and response messages carry data in the form of a letter with MIME-like format. video. Unlike SMTP. headers. HTTP is like SMTP because the data transferred between the client and server look like SMTP messages. Messages : There are two general types of HTTP messages.The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. hypertext. SMTP messages are stored and forwarded. to the server. to the client. it is much simpler than FTP because it uses only data are transferred between the client and the server. the format of the messages is controlled by MIME-like headers. The protocol transfer all data in the form of plain text. However. Response Message: A response message consists of a status line. Example: Method :// Host: Port / Path Version:. 4. URL (uniform resource locator):-specifying any kind of information on the internet.is a computer where the information is located 3. If the port is included. Request type:-categorized into methods. Path:. Header:.redirect the client to another URL 400-client error 500-server error Status line:. in the UNIX operating system. This is not mandatory. although the name can be an alias.defines the status of the response message.1 Status code:.current version 1. GET. 1.is the path name of the file where the information is located.sends a document from server to the client. it should be inserted between the host and the path.request a document from server PUT. as the host can be any name given to the computer that hosts the web page. and computers are given alias names that usually begin with the characters ―www‖. port and path. Method:.contain additional information to be exchanged between the client and the server Format of header line: name : space Header value Header Name 132 | P a g e : Header value CS6551 COMPUTER NETWORKS . Port:. separate the directories from subdirectories and files. Note that the path can itself contain slashes that. It defines method. however. Web pages are usually stored in computers.is a protocol to retrieved the documents(FTP. host. Host:. The URL optionally can contain the port number of the server. The host is the computer where the information is located.is the port number of the server. and it should be separated from the host by a colon.a three digit code similar to FTP & SMTP. 100 ranges-informational 200-successful request 300.HTTP) 2. So there is a need to map name to address and vice versa.. • The user generally enters a host name. To reduce the load on the original server. date. email. A proxy server is a computer that keeps copies of responses to recent requests. Entity header:.it specifies client configuration and client preferred document format. • An name has more meaning to a user than a 4 byte number. If the response is not stored in the cache. Incoming responses are sent to the proxy server and stored for future requests from other clients. Response header:. The HTTP client sends a request to the proxy server.it specifies server configuration and special information about the request.Four types of header line: General header. People prefers to use names instead of address. all require the user to input a destination. DNS(DOMAIN NAME SPACE) DNS is a client /server application that provides name services for other application. TCP/IP protocols use the IP address to identify an entity. 133 | P a g e CS6551 COMPUTER NETWORKS . • The application takes the host name supplied by the user and forwards it to DNS for translation to an IP address. etc. Proxy server HTTP supports proxy servers. connection.gives information about the body of the document BODY: can be present in the request or response message. • Applications such as FTP. The proxy server checks its cache. the proxy server sends the request to the corresponding server. HTTP.contains general information like cache control. Request header:. DNS maps name to address Why DNS? • It is easier to remember a host name than it is to remember an IP address. decrease the traffic and to improve the latency. which is a string with a maximum of 63 characters. There are two types of Domain name. A name space that maps each address to a unique name can be organized in two ways: flat or hierarchical. The first part can define the nature of the organization. 1. A name in this space is a sequence of characters without structure. the second part can define the name of an organization and the third part can define departments in the organization.NAME SPACE: To be unambiguous.smart. PQDN (partially qualified Domain name). the names must be unique because the addresses are unique.com) DOMAIN NAME SPACE Structure for organizing the name space in which names are defined in an inverted-tree structure with the root at the top Each level of the tree defines a hierarchical level LABEL: Each node in the tree has a Label.berkeley. challenger. In other words. In a flat namespace . the names assigned to machines must be carefully selected from a name space with complete control over the binding between the names and IP addresses.g) challenger. In a hierarchical name space.(e.edu. 3. a name is assigned to an address. DOAMIN NAME: Each node in the tree has a Domain name. It cannot be used in large system. The root label is a null string. 134 | P a g e CS6551 COMPUTER NETWORKS . each name is made of several parts. FQDN(Fully qualified Domain name) 2. Domain: A domain is a subtree of the DNS. the domain name space (tree) is divided into three different sections: Domain name space is divided into three sections: generic. In the Internet.If a label is terminated by null string.define registered hosts by generic behavior Country domains :.FQDN:. A PQDN starts from a node. country and inverse Generic domains :. but does not reach the root. it is called FQDN.used to identify national designations. PQDN: . it is called PQDN. It uses two character country abbreviations Inverse domain is used to map an address to a name (address-to-name resolution) Generic domains:- 135 | P a g e CS6551 COMPUTER NETWORKS . DNS IN THE INTERNET: DNS is a protocol that can be used in different platforms.If a label is not terminated by null string. Country domains Inverse domain Current domain name system: • • 136 | P a g e A hierarchical.net . domain-based naming scheme and a distributed database system Hierarchical naming scheme – name space partitioned in subdomains. – Top level of domains: .us .com .cn .mil .edu .org .jp .gov .nl CS6551 COMPUTER NETWORKS . • – Each domain can have subdomains – Simple name .vs. RESOLUTION Mapping a name to an address or an address to a name is called name-address resolution. 137 | P a g e CS6551 COMPUTER NETWORKS . – Naming follows organization boundary not physical network boundary. A root server usually does not store any information about domain but delegates its authority to other servers. Hierarchy of name servers Zones : The complete domain name hierarchy cannot be stored on a single server. When a server is responsible for or has authority over is called a zone. it is called zone transfer. When the secondary downloads information from the primary. fully qualified domain(absolute) name Distributed the delegation of naming authority – Each domain has the authority to allow names within that domain. it is divided among many servers. the secondary server loads all information from the primary server. ROOT SERVER: A root server is a server whose zone consists of the whole tree. A primary server loads all information from the disk file. answer records. authoritative records. Header format Identification subfield: used by the client to match the response with the query. The header is 12 bytes and its format is shown. The response message consists of a header.DNS MESSAGES DNS has two types of messages: query and response. The query message consists of a header and question records. and additional records Header Both query and response message have the same header format with some fields set to zero for the query message. question records. 138 | P a g e CS6551 COMPUTER NETWORKS . Both types have the same format. A registrar first verifies that the requested domain name is unique and then enters it into the DNS database. A fee is charged. DNS can be attacked in several Ways. it provides crucial services to the Internet users. removing a host. Question record format Resource record format REGISTRARS How are new domains added to DNS? This is done through a registrar.TYPES OF RECORDS Two types of records are used in DNS. The resource records are used in the answer. In DNS. IETF (Internet Engineering Task Force ) has devised a technology named DNS Security (DNSSEC) that provides the message origin authentication and message integrity using a security service called digital signature 139 | P a g e CS6551 COMPUTER NETWORKS . DDNS: When the DNS was designed. such as adding a new host. no one predicted that there would be so many address changes. The DNS master file must be updated dynamically. a commercial entity accredited by ICANN. SECURITY OF DNS: DNS is one of the most important systems in the Internet infrastructure. when there is a change. the change must be made to the DNS master file. or changing an IP address. To protect DNS. The Dynamic Domain Name System (DDNS) therefore was devised to respond to this need. The question records are used in the question section of the query and response messages. authoritative and additional information sections of the response message. Applications such as Web access or e-mail are heavily dependent on the proper operation of DNS. An agent to send an alarm message about an abnormal situation to the manager. That is. a manager. SNMP uses the concept of manager and agent. management on the Internet is done through the cooperation of three protocols: SNMP.SNMP(SIMPLE NETWORK MANAGEMENT PROTOCOL) SNMP uses both SMI and MIB in Internet network management. usually a host. Management overview 140 | P a g e CS6551 COMPUTER NETWORKS . and showing how to encode objects and values. In other words. SMI defines the general rules for naming objects. usually routers or servers To do management tasks. 2. A manager to store a value in an object defined in an agent. Companion of network management on the Internet SNMP defines the format of packets exchanged between a manager and an agent. A manager to retrieve the value of an object defined in an agent. MIB creates a collection of named objects. controls and monitors a set of agents. SMI. defining object types (including range and length). SNMP uses two other protocols: Structure of Management Information (SMI) and Management Information Base (MIB). and MIB. their types. It is an application program that allows: 1. 3. and their relationships to each other in an entity to be managed. It reads and changes the status of objects (values of variables) in SNMP packets. 2. It emphasizes three attributes to handle an object: name. 3. Conceptual data types: 141 | P a g e CS6551 COMPUTER NETWORKS .SMI: The Structure of Management Information is a component for network management. data type. Object identifier: All objects managed by SNMP are given an object identifier. To name objects.3.1.2.6. The object identifier always starts with 1. SMI is a guideline for SNMP. To define the type of data that can be stored in an object. To show how to encode data for transmission over the network. and encoding method. Its functions are: 1.1. address translation. Each agent has its own MIB2. ip. transmission. These groups are under the mib-2 object in the object identifier tree. egp. icmp. which is a collection of all the objects that the manager can manage. version 2 (MIB2) is the second component used in network management. The objects in MIB2 are categorized under 10 different groups: system. Each group has defined variables and/or tables. and snmp. udp. Lexicographic ordering 142 | P a g e CS6551 COMPUTER NETWORKS .Encoding format MIB: The Management Information Base. interface. tcp. SNMPv3 allows a manager to choose one or more levels of security when accessing an agent. taking their name from the term for the individual applications that offer a remotely accessible service to client applications to form network applications. at least in theory. and modular partial specifications that can be reused across protocols. WEB SERVICES: Web Services. however. The key elements of that approach are a framework for protocol specification. The web architecture‘s strengths include stability and a demonstrated scalability (in the network-size sense). Different aspects of security can be configured by the manager to allow message authentication. It could be considered a weakness that HTTP is not well suited to the usual procedural or operation-oriented style of invoking a remote service. to generate protocols that are customized to each network application—a kind of mass customization. SNMPv3 also allows remote configuration of security aspects without requiring the administrator to actually be at the place where the device is located.SECURITY OF SNMP SNMPv3 has added two new features to the previous version: security and remote administration. software toolkits for automatically generating protocol implementations from the specifications. REST advocates argue. the REST architecture is just the web architecture. The two Web Services architectures are SOAP and REST discuss the technical meanings of those terms shortly. confidentiality. Custom Application Protocols (WSDL. The SOAP architecture‘s approach to the problem is to make it feasible. and integrity. Essentially. SOAP) 143 | P a g e CS6551 COMPUTER NETWORKS . that rich services can nonetheless be exposed using a more data-oriented or document passing style to which HTTP is well-suited. The REST architecture‘s approach to the problem is to regard individual Web Services as World Wide Web resources—identified by URIs and accessed via HTTP. g.WSDL and SOAP are frameworks for specifying and implementing application protocols and transport protocols. and reusable specification elements identified using XML namespaces. A URI that identifies the feature. CheckAvailability and MakeReservation. The information to be relayed to the next node. or a framework for defining protocols. An example from W3C‘s WSDL Primer is a hotel reservation web service with two operations. Defining Transport Protocols Although SOAP is often called a protocol. bindings to underlying protocols. SOAP‘s role is to make it easy to define a transport protocol with exactly the desired semantics regarding protocol features such as reliability and security. Defining Application Protocols WSDL has chosen a procedural operation model of application protocols. respectively. each representing a simple interaction between a client and the web service. the life cycleand temporal/causal relationships of the messages exchanged (e. If the feature is a MEP. An operation is analogous to a remotely callable procedure in an RPC system. As the SOAP 1. The state information and processing. abstractly described. that is required at each SOAP node to implement the feature. although WSDL can be used to specify an application protocol that uses a transport protocol not specified using SOAP. They are generally used together. and whether an operation involves a response. MEPs. WSDL is used to specify application-specific details suchas what operations are supported. 144 | P a g e CS6551 COMPUTER NETWORKS . the formats of the application data to invoke or respond to those operations.The architecture informally referred to as SOAP is based on Web Services Description Language (WSDL) and SOAP.2 specification explains. This is the architecture that people usually mean when they use the term Web Services.2 Both of these standards are issued by the World Wide Web Consortium (W3C). including message formats defined using XML Schema. An abstract web service interface consists of a set of named operations. and a SOAP-based protocol can transport a non-WSDL application protocol. it is better thought of as the foundation of a family of protocols.. ―SOAP provides a simple messaging framework whose core functionality is concerned with providing extensibility. responses follow requests and are sent to the originator of the request).‖ SOAP uses many of the same strategies as WSDL. That architecture is designed to make it practical to specify and implement all those protocols. 145 | P a g e CS6551 COMPUTER NETWORKS . This model.2).A Generic Application Protocol (REST) The WSDL/SOAP Web Services architecture is based on the assumption that the best way to integrate applications across networks is via protocols that are customized to each application. is known as REpresentational State Transfer(REST). the REST Web Services architecture is based on the assumption that the best way to integrate applications across networks is by applying the model underlying the World Wide Web architecture (Section 9. articulated by Web architect Roy Fielding.1. In contrast.