Unit 1 Final-merged.pdf
Document Details
Uploaded by Deleted User
Tags
Full Transcript
COMPUTER COMMUNICATION NETWORKS (UE22EC351A) Department of Electronics and Communication Engineering 1 COMPUTER COMMUNICATION NETWORKS UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 1 – Internet: Introduction, Terminology – Text...
COMPUTER COMMUNICATION NETWORKS (UE22EC351A) Department of Electronics and Communication Engineering 1 COMPUTER COMMUNICATION NETWORKS UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 1 – Internet: Introduction, Terminology – Text book reference – Section 1.1 – Pages 32 - 39 Department of Electronics and Communication Engineering 3 Class 1 - Introduction What is a computer network? It is like a graph consisting of end-systems or hosts connected to one another via communication links and some packet switches. End-systems or hosts run applications which generate or receive data in the form of packets (i.e., collection of bits) A sequence of packet switches and communication links is called route or path A computer network is usually administered by one entity which configures and maintains the operation Examples of computer networks include home networks, enterprise networks, mobile networks, etc. Hosts 4 connect to the internet via ISPs Class 1 - Introduction What is internet? Internet is a computer network that interconnects billions of computing devices throughout the world. Internet is an interconnected architecture that provides services to distributed applications. How did it come about? History of the internet: DARPA, ARPANET, Packet switched networks, killer applications, TCP/IP, Ethernet, DNS, NSFNET program, IANA, ICANN, RFC, IETF and IESG, IAB 5 Class 1 - INTERNET - VISUALIZATION 6 Class 1 - Introduction Notable inventions and inventors World wide web: Tim Berners Lee, MIT laboratory 1989-90 Email: Ray Tomlinson, BBN 1972 DNS: Paul Mockapetris, USC 1982 RFC: Stephen Crocker, UCLA 1969 Packet switching: Leonard Kleinrock, UCLA 1961 TCP/IP: Bob Khan and Vincent Cerf, DARPA and SRI 1972-73 Ethernet: Bob Metcalfe, Xerox PARC 1973 7 Class 1 - Introduction Who owns/controls the internet? ISP (Internet Service Provider) is a business entity or company which provides internet access to the end-systems in return for a subscription fee The place where end-systems connect to an ISP is referred to as point-of-presence (PoP). The number of PoPs (typically in 1000s) held by an ISP tells about its outreach in the internet. PoP consists of routers, link layer switches, MPLS and communication links. ISP examples: Telecom operators, Cable TV operators, Fiber (optic) operators 8 Class 1 - Introduction ISP Hierarchy 9 Class 1 - Introduction ISP hierarchy (contd.) 10 Class 1 - Introduction Revenue generation is as follows: End users pay access ISPs Access ISPs pay to regional ISPs Regional ISPs pay to Tier 1 ISPs Tier 1 ISPs may have several bilateral agreements to share resources such as bandwidth and routers Besides, content service providers can enter into bilateral agreements with an ISP at any stage ISPs which perform peering or multi-homing share some of their revenue based on equipment and resource utilization 11 Class 1 - Introduction How does the internet provide services for distributed applications (i.e., programs written in Java, C, etc.)? Distributed means that applications run independently on the hosts or end systems Messages are exchanged by the hosts using the internet socket interfaces of their respective applications Protocols define the format and the order of messages exchanged between two or more hosts Protocols also define the actions taken on the transmission and/or receipt of a message or other event Services (e.g., reliability, guaranteed rate) are provided by hardware or software associated with the devices 12 Class 1 - Classification by topography and functionality 13 COMPUTER COMMUNICATION NETWORKS UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 2 – Network Edge – Text book reference – Section 1.2 – Pages 39 - 51 Department of Electronics and Communication Engineering 2 Class 2 - Network edge Computer networks that sit on the periphery of the internet constitute the network edge or the access network End-systems can be further classified as clients and servers Router which connect an access network to a regional/access ISP is referred to as gateway Access network nomenclature Based on size: Local area networks, home networks, wide area networks, etc. Based on topology: Tree, star, ring, bus, point-to-point. Based on physical media: Wired (DSL, Cable, Fiber to the home (FTTH)) or wireless 3 Class 2 - Network edge Home access networks The devices in the home are connected to the internet via a LAN or Wifi router Different physical media could be provided by different access ISPs to connect the home network with the internet 4 Class 2 - Network edge This home network consists of a roaming laptop, multiple Internet-connected home appliances, as well as a wired PC; a base station(the wireless access point), which communicates with the wireless PC and other wireless devices at home. 5 Class 2 - Network edge A home router that connects the wireless access point, and any other wired home devices to the internet. This network allows household members to have broadband access to the internet with one member roaming from the kitchen to the backyard to the bedrooms. 6 Class 2 - Network edge Home access networks An infrastructure handled by a telecom or cable or fiber operator General architecture is given below Home Central office Modem Local multiplexer Core Multiplexer Network Router Home Modem 7 Class 2 - Network edge Feature DSL based access Cable TV based FTTH based network access network access network Modem DSL modem Cable modem Optical modem Local multiplexer Splitter Fiber node Optical network terminator Central office DSL access Cable modem Optical line (CO) multiplexer terminating terminator (OLT) (DSLAM) system (CMTS) Downlink rates 12 Mbps [ITU DOCSIS 2.0 100 Mbps (cable 1999] and 24 standard 42.8 length based) Mbps [ITU 2003] Mbps Uplink rates 1.8 Mbps [ITU DOCSIS 2.0 30 Mbps (cable 1999] and 2.5 standard 30.7 length based) Mbps [ITU 2003] Mbps 8 Class 2 - Network edge DSL Internet Access DSL is used when a customer’s telephone company is also its ISP. Each customer’s DSL modem uses the existing telephone line exchange data with a digital subscriber line access multiplexer (DSLAM) located in telephone company’s local central office 9 Class 2 - Network edge DSL Internet Access The Home’s DSL modem takes digital data and translates it into high frequency tones for transmission over telephone wires to the CO; The analog signals from many such houses are translated back into digital format at the DSLAM. 10 Class 2 - Network edge A hybrid fiber-coaxial access network Fibre Optics connect the cable head end to neighborhhood-level junctions, from which traditional coaxial cable is then used to reach individual houses & apartments. 11 Class 2 - Network edge-A hybrid fiber-coaxial access network Each neighborhood junctions typically supports 500 to 5,000 homes. Because both fiber & coaxial cable are employed in this system, it is often referred to as hybrid fiber coax (HFC). 12 Class 2 - Network edge-A hybrid fiber-coaxial access network At the cable head end, the cable modem termination system (CMTS) serves a similar function as the DSL network’s DSLAM – turn the analog signal sent from the cable modems in many downstream homes back into digital format. 13 Class 2 - Network edge-FTTH Internet Access Figure shows Fiber to the Home(FTTH) using Passive Optical Networks (PON) distributed architecture. Each home has an optical network Terminator (ONT) which is connected by dedicated optical fiber to a neighborhood splitter. 14 Class 2 - Network edge-FTTH Internet Access The splitter combines a number of homes onto a single, shared optical fiber, which connects to an optical line terminator(OLT) in the telephone company’s central office (CO) 15 Class 2 - Network edge-FTTH Internet Access The OLT, providing conversion between optical and electrical signals, connects to the internet via a telco router. 16 Class 2 - Network edge – Enterprise Access Network Enterprise access network ISP can be telecom operator Built using Ethernet cables, switches and hubs Ethernet switches are preferred over routers in a LAN Routers are used for separating the network into subnets 17 Class 2 - Network edge – Enterprise Access Network - Ethernet users use twisted-pair copper wires to connect to an Ethernet switch. - The Ethernet switch, or a network or such interconnected switches, is then connected into the larger internet. 18 Class 2 - Network edge - With Ethernet access, users typically have 100 Mbps to tens of Gbps access to the Ethernet switch, whereas servers may have 1 Gbps or 10Gbps access. 19 Class 2 - Network edge Wireless networks: Classified according to radio access technologies Spread spectrum, frequency hopping, random access, polling methods, etc. More complex compared to wired access networks Packet losses and time varying wireless channel characteristics Wireless networks can be WiFi-based or cellular-based Wireless networks are usually supported by telecom ISPs Span of wireless networks can be few meters to several kilo meters Wireless networks have undergone tremendous evolution especially with the exploding data requirements of the users 20 Class 2 - Network edge Satellite access networks: Remote end systems get access to the internet via satellite links Implemented when other access networks are not feasible Has lowest data rates among access networks The delays are higher. It depends on the distance between the satellite and the users and the type of satellite 21 Class 2 - Network edge Satellite access networks: A communication satellite links two or more Earth-based microwave transmitter/receivers, known as ground stations. The satellite receives transmissions on one frequency band, regenerates the signal using a repeater and transmits the signal on another frequency. Types of satellites: geostationary satellites and low-earth orbiting (LEO) satellites Geostationary satellites permanently remain above the same spot on earth. This stationary presence is achieved by placing the satellite in orbit at 36,000 kilometers above Earth’s surface. This huge distance from ground station through satellite back to ground station introduces a substantial signal propagation delay. 22 COMPUTER COMMUNICATION NETWORKS UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 3 – Network Core – Text book reference – Section 1.3 – Pages 52-56,64 Department of Electronics and Communication Engineering 3 Class 3 - Network core Also known as backbone network Consists of high speed routers and high speed links (Gigabit Ethernet/optical fibers) Cisco NCS6000 router 4 Class 3 - Network core Network core is part of the internet which is composed of high-speed packet switches and high- speed communication links Network core is constructed using the interconnection of ISPs The packet switches (routers) perform store and forward operation 5 Class 3 - Network core Traffic from access ISPs are aggregated using multiplexers Multiplexers are interconnected to more distant switches through a backbone network Network core follows mesh topology with lot of redundancy Some design problems in network core include: Satisfy delay and reliability constraints Routing Assigning capacity (Flow maximization problem) Cost improvement 6 Class 3 - Network core Routers in the network core perform switching Routers have several links on which packets arrive and depart Switching involves transfer of an incoming packet from one link to an appropriate outgoing link based on IP protocol The switching operation can be done by hardware and/or software Different types of switching performed in the network core Circuit switching Packet switching 7 Class 3 - Network core Circuit switching: Requires connection establishment before data transfer Resources are allocated by every intermediate switch/router between the source and destination hosts Resource example: Fixed link bandwidth, internal memory In telephony, when a path is established between the source and destination we can say a circuit is formed After data transfer, the circuit is closed by releasing the reserved resources at each intermediate router No waiting time and no loss of data at intermediate routers Throughput reduces with resource sharing 8 Class 3 - Network core Circuit switching: A circuit in a link is established either by frequency division multiplexing (FDM) or time division multiplexing (TDM) 9 Class 3 - Network core TDM- Time division multiplexing: Time is divided into frames and frames into slots Slots in a frame are reserved for the transmitting hosts Each slot ends with a guard time to prevent ISI Duration of frame, slot, guard time are fixed 10 Class 3 - Network core FDM- Frequency division multiplexing: Bandwidth is divided into channels All channels reserved for transmitting hosts in a fixed slot time Channel reservation done slot-by-slot-basis Channels separated by guard band to prevent adjacent channel interference 11 Class 3 - Network core Numerical #1: How long does it take to send a file of 640,000 bits from host A to host B over a circuit-switched network? All links are 1.536 Mbps Each link uses TDM with 24 slots/sec Guard time is equal to (1/8)th of the slot time 500 msec to establish end-to-end circuit 12 Class 3 - Network core Numerical #2: How long does it take to send a file of 640,000 bits from host A to host B over a circuit-switched network? Available link rate is 1.536 Mbps Link rate is distributed across 10 channels of 200 kHz Guard band of 50 Hz is used 500 msec to establish end-to-end circuit 13 Class 3 - Network core Packet switching: Data broken into smaller chunk called packets No reservation of resources Suited for bursty traffic Better link utilization Packets are stored in buffer and then forwarded one at a time Requires protocols for link access and reliable packet delivery 14 Class 3 - Network core Packet switching (contd.): Packets may suffer queuing delays and get lost at the routers This happens when rate of arrivals exceeds the rate of departure 15 Class 3 - Network core Packet switching versus Circuit switching – Case 1: Suppose users share a 1 Mbps link. Also suppose that each user alternates between periods of activity when a user generates data at a constant rate of 100 kbps, and periods of inactivity when a user generates no data. Suppose further that a user is active only 10 percent of the time. With circuit switching, 100 kbps must be reserved for each user at all times. For example, with TDM, if a one-second frame is divided into 10 time slots of 100 ms each, then each user would be allocated a one-time slot per frame. Thus, the circuit-switched link can support only 10 (= 1 Mbps/100 kbps) simultaneous users. 16 Class 3 - Network core Packet switching versus Circuit switching – Case 1: With packet switching, the probability that a specific user is active is 0.1. If there are 35 users, the probability that there are 11 or more simultaneously active users is approximately 0.0004. When there are 10 or fewer simultaneously active users (which happens with probability 0.9996), the aggregate arrival rate of data is less than or equal to 1 Mbps. When there are more than 10 simultaneously active users, then the aggregate arrival rate of packets exceeds the output capacity of the link, and the output queue will begin to grow. Thus, packet switching performs same as circuit switched TDM but serves more than three times the number of users. 17 Class 3 - Network core Packet switching versus Circuit switching – Case 2: Suppose there are 10 users and that one user suddenly generates one thousand 1,000-bit packets, while other users remain quiescent and do not generate packets. Under TDM circuit switching with 10 slots per frame and each slot consisting of 1,000 bits, the active user can only use its one-time slot per frame to transmit data, while the remaining nine-time slots in each frame remain idle. It will take 10 seconds Under packet switching, the active user can continuously send its packets at the full link rate of 1 Mbps, since there are no other users has packets for transmission. In this case, it will take 1 second 18 COMPUTER COMMUNICATION NETWORKS (UE22EC351A) UNIT 1 – Classes 4 & 5 – Delay, Loss & Throughput in Packet-Switched Networks – Text book reference – Section 1.4 – pages 65 to 76 Department of Electronics and Communication Engineering 3 Classes 4 & 5 - Delay, loss and throughput The different delays that occur in packet switched transmission are depicted below 4 Classes 4 & 5 - Delay, loss and throughput ❑ Processing delay: Time taken to inspect (or make) a packet at a packet switch (or source host). Range: Microseconds ❑ Queuing delay: Time spent by a packet in the queue before processing. Depends on the number of packets waiting ahead, traffic intensity and distribution of the arrival process. Range: Microseconds to milliseconds ❑ Transmission delay: Time taken to push a packet on to the link. Depends on length of the packet (L bits) and link rate (R bits/sec). Expressed as L/R ❑ Propagation delay: Time taken by a bit to travel over a link. Depends on the length of the link and the physical medium’s propagation speed (e.g., 2×108 to 3×108 m/s). 5 Classes 4 & 5 - Delay, loss and throughput ❑ Traffic intensity versus queuing delay ❖ Suppose arrival rate is a packets per sec and departure rate is L/R seconds per packet, then traffic intensity is given by La/R ❖ Let buffer size be infinite ❖ When La/R < 1, every new packet sees an empty queue ❖ When La/R ≥ 1, queue starts to When buffer is finite build up and mean queuing and La/R ≥ 1, then delay could approach infinity packet losses occur 6 Classes 4 & 5 - Delay, loss and throughput ❑ Traffic intensity versus queuing delay ❖ a = average rate at which packets arrive at the queue ❖ R = transmission rate ❖ L = no of bits/packet ❖ Average rate at which bits arrive at the queue = La bits/sec ❖ Traffic intensity = La/R plays an important role in estimating the extent of queuing 7 delay Classes 4 & 5 - Delay, loss and throughput ❑ Traffic intensity versus queuing delay ❖ La/R > 1 – average rate at which bits arrive at the queue exceed the rate at which the bits can be transmitted from the queue. ❖ Queuing delay approaches infinity ❖ Case 1 - If traffic intensity is close to 0 – Packets arrival are8 few & far between. Classes 4 & 5 - Delay, loss and throughput ❑ Traffic intensity versus queuing delay ❖ It is unlikely that an arriving packet will find another packet in the queue. ❖ In this case, Average queuing delay will be zero. ❖ Case 2 – Traffic Intensity is close to 1 – There will be intervals of time when the arrival rate exceeds the transmission capacity & a queue will form during these periods of time 9 Classes 4 & 5 - Delay, loss and throughput End-to-end delay (dend-end): The total time spent by a packet to travel from the source to the destination. End-to-end delay is the sum of the delays at the source, delays at each packet switch and the propagation delays on each communication link along the path. Delay at a packet switch equals the sum of queuing delay, processing delay and transmission delay Consider N–1 identical and uncongested routers between the source and destination. Let all N–1 links be identical. Let propagation delay on any link, transmission delay and processing delay at any router and source be denoted by dprop, dtrans and dproc respectively. What is the end-to-end delay? 10 Classes 4 & 5 - Delay, loss and throughput Numerical #3: For the scenario given below, assume the queuing delay, propagation delay and processing delay to be negligible. Suppose packet length L = 7.5 Mb and link rate R = 1.5 Mbps. Calculate the end-to-end delay. Solution – 3L/R Packet Loss – A packet can arrive to find a full queue With no place to store such a packet, a router will drop that packet; the packet will be lost. 11 Classes 4 & 5 - Delay, loss and throughput Throughput is the rate (bits/sec) at which the destination host receives the packets. Instantaneous throughput is the throughput at a given time instant whereas average throughput is throughput over the entire file transfer time (e.g., F/T where F is file size and T is file transfer time). Example: What is the maximum achievable throughput? 12 Classes 4 & 5 - Delay, loss and throughput Example: What is the maximum achievable throughput? Case 1 – Rs < Rc – The bits pumped by the server will flow right through the router & arrive at the client at a rate of Rs bits/sec giving a throughput of Rs bits/sec 13 Classes 4 & 5 - Delay, loss and throughput Example: What is the maximum achievable throughput? Case 2 – Rc < Rs – The router will not be able to forward bits as quickly as it receives them. Bits will only leave the router at rate Rc, giving a throughput of Rc bits/sec For a simple two-link network, throughput = min{Rc,Rs} 14 Classes 4 & 5 - Delay, loss and throughput Example: Suppose you are downloading a MP3 file of F = 32 million bits, the server has a transmission rate of Rs = 2 Mbps & Rc = 1 Mbps What is the time needed to transfer the file ? Solution – T = F/ min {Rc,Rs} = 32 *10^6 / 1*10^6 = 32 seconds 15 Classes 4 & 5 - Delay, loss and throughput Example: What is the maximum achievable throughput in the following cases? Let the link rate in the access networks and the bottleneck link in the network core be R=10 Mbps 16 Classes 4 & 5 - Delay, loss and throughput Example: What is the maximum achievable throughput in the following cases? Consider 10 servers & 10 clients connected to the core of computer network. There are 10 simultaneous downloads taking place involving client- server pairs There is a link in the core that is traversed by all 10 downloads Let R be the transmission rate of this link Server access links have the rate Rs Client access links have the rate Rc 17 Classes 4 & 5 - Delay, loss and throughput Suppose Rs = 2 Mbps, Rc = 1 Mbps, R = 5 Mbps, and the common link divides its transmission rate equally among the 10 downloads. The bottleneck for each download is no longer in the access network, but is now instead the shared link in the core, which only provides each download with 500 kbps of throughput. Thus, the end-to-end throughput for each download is now reduced to 500 kbps 18 COMPUTER COMMUNICATION NETWORKS UNIT 1– Class 6 – Numericals on Delay, Loss & Throughput in Packet-Switched Networks Department of Electronics and Communication Engineering 3 Numerical 4: Consider a 3 Mbps link being shared by 10 users. Suppose we want to achieve maximum throughput using circuit switching. What should be the maximum data packet size for a user assuming 10% guard interval? Assuming a user wants to transmit 64000 bits of data how much time will he take to complete full data transmission? Solution: Throughput is maximized so link rate is divided equally among the users. So per user gets (R) 0.3Mbps. Slot time = 1/10 = 0.1s Transmission delay (dt) = 0.09 sec (i.e., excluding the 10% of the slot time). So the maximum packet size L = dt * R =0.3M * 0.09 = 27 kb To transfer 64000 bits of data, the user spends 64kb / 27kb = 2.37 sec 4 Numerical 4 (contd.): Consider a 3 Mbps link being shared by 10 users. Suppose packet switching is used. What is the maximum achievable throughput? Assuming every user is active only 10% of the time and transmits at a rate of 1Mbps. What is the probability of no queuing? Solution: Maximum achievable throughput is 3Mbps. However, user only transmits at the rate of 1Mbps. Probability of one user being active (p) is 0.1. As long as there are less than or equal to 3 active users, the rate of transmission will not exceed the link rate so no queuing occurs. Therefore, 5 Solution (contd.): Numerical 5: Suppose there is a 10 Mbps microwave link between a geostationary satellite and its base station on Earth. Every minute the satellite takes a digital photo and sends it to the base station. Assume a propagation speed of 2.4×108 m/s. What is the propagation delay of the link? What is the bandwidth-delay product, R · dprop? Let x denote the size of the photo. What is the minimum value of x for the microwave link to be continuously transmitting? Solution: Propagation delay is (36000 km)/(2.4×108 m/s) = 150 ms Bandwidth-delay product 1500 kb Time between photo transmission is 60s therefore, transmit 600 Mb6 Numerical 6: Consider the figure below where transmission delay is the only significant delay. Each link is 2Mbps. Suppose the number of links N is 3. Calculate the end to end delay for the two cases given below. Note that each switch is a store and forward switch. 1. If message of size 8 Mb is transferred without segmentation. 2. If the message is segmented into 800 packets of 10 kb length. Solution: 1. L = 8 Mb, End to end delay = 3 × L/R = 12 sec 2. L = 10 kb, End to end delay = 800 × 3 × L/R =12 sec What about throughput of the connection? 7 What if the links have different rates? Numerical 6: Solution (Continued) What about throughput of the connection? What if the links have different rates? Ignoring the delays, the throughput is usually constrained by the lowest link rate on the path. In case of multiple flows, the lowest link rate is divided proportionally among the flows. In the above example, where transmission delay is the only significant delay and all links had same link rate, the overall time taken to transfer 800 packets of 10 kb length took 12 seconds. Therefore, the throughput is given by 8 Mb / 12 sec = 0.667 Mbps 8 Unit 1 – Class 10 – Numerical Problems 7) Consider the network given in the next slide where M client-server pairs communicate through the common network link. Denote Rs , Rc , and R for the rates of the server links, client links, and network link. Assume all other links have abundant capacity and that there is no other traffic in the network besides the traffic generated by the M client-server pairs. Answer the following: 1) Derive a general expression for maximum throughput for any user in terms of Rs , Rc , R, and M. ------------- 2 marks 2) Suppose one of the clients has to transfer a file of size F = 32 Mb to corresponding server and the values of Rs, Rc, R, and M are 2 Mbps, 1 Mbps, 5 Mbps and 10 respectively. Find the minimum time taken to transfer the file. ---------- 3 marks 9 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 7) Solution 1) The maximum throughput is given by min(Rs,Rc,R/M) because the network link is divided equally among the M Connections. 2) Given the values of Rs, Rc, R and M we get the maximum throughput as 500 kbps. Therefore, the minimum file transfer time is given by F/min(Rs,Rc,R/M) = 32*10^6/ 500*10^3 = 64 seconds 10 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Suppose only one process communication takes place as shown in the figure above. Suppose the client downloads a large file of size F bits from the server. Assume negligible bit propagation time. 1) What is throughput? 1) Solution - Throughput refers to the rate at which a host receives the data (bits/sec). 2) Write an expression for the throughput experienced by the client. 2) Solution - Throughput experienced by client is given by min{R1,R2…RN} 11 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Suppose only one process communication takes place as shown in the figure above. Suppose the client downloads a large file of size F bits from the server. Assume negligible bit propagation time. 3) Write an expression for the time taken by the client to download the file. 3) Solution – Delay experienced by client is given by F/min{R1,R2,…RN} 12 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Suppose only one process communication takes place as shown in the figure above. Suppose the client downloads a large file of size F bits from the server. Assume negligible bit propagation time. 4) When does queuing delay not occur in the figure above? 4) Solution – Queuing delay does not occur when the client transmits at a rate less than the throughput min{R1,R2…RN} 13 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Suppose only one process communication takes place as shown in the figure above. Suppose the client downloads a large file of size F bits from the server. Assume negligible bit propagation time. 5) How can the throughput be improved? 5) Solution – Throughput can be improved if the file is broken into packets. In other words, packet switching must be used. 14 Computer Communication Networks (UE22EC351A) Unit 1 – Internet Architecture & Applications – Class 10 – Numerical Problems Prof. Rajesh. C Department of ECE, PESU-EC Campus 2 Computer Communication Networks (UE21EC351A) - Unit 1 – Class 10 – Numerical Problems - 1) Suppose a file of 20,000 bits is to be transferred from Host A to Host B as shown in the figure. Suppose that data is divided into 4 packets of equal size. Suppose all four links have an identical rate of 2Mbps and are 10 km long. Assume Optical links, and no processing & queuing delays. Calculate the total time to deliver the packets? 3 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 4 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems - 2) A user can directly connect to a server through either long-range wireless or a twisted-pair cable for transmitting a 1500 bytes file. The transmission rates of the wireless & wired media are 2 & 100 Mbps respectively. Assume that the propagation speed in air is 3*10^8 m/s, while the speed in the twisted pair is 2*10^8 m/s. If the user is located 1 km away from the server, what is the nodal delay when using each of the two technologies? - Solution – 5 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems - 2) Solution – 6 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems - 3) Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1 = 500 kbps , R2 = 2 Mbps , R3 = 1 Mbps. - Assuming no other traffic in the network, what is the throughput for the file transfer ? - Suppose the file is 4 million bytes. Dividing the file size by the throughput, roughly how long will it take to transfer the file to Host B? - Repeat (a) & (b), but now with R2 reduced to 100 kbps 7 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems - 4) Suppose N packets arrive simultaneously to a link at which no packets are currently being transmitted or queued. Each packet is of length L and the link has transmission rate R. What is the average queuing delay for the N packets? Solution - Each packet experiences a queuing delay which is equal to the sum of the transmission delays of the packets ahead of it in the queue. So packet 1 has 0 delay, packet 2 has L/R delay, …, packet N has (N-1)L/R delay. The average queuing delay is given by (0+L/R+2L/R+…+(N-1)L/R)/N = (L/R)×(N-1)/2 8 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 5) A packet switch receives a packet and determines the outbound link to which the packet should be forwarded. When the packet arrives, one other packet is halfway done being transmitted on this outbound link and four other packets are waiting to be transmitted. Packets are transmitted in order of arrival. Suppose all packets are 1,500 bytes and the link rate is 2 Mbps. What is the queuing delay for the packet? More generally, what is the queuing delay when all packets have length L, the transmission rate is R, x bits of the currently-being-transmitted packet have been transmitted, and n packets are already in the queue? 9 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 5) Solution - The queuing delay is given by the sum of the transmission delays of n packets ahead of it plus the time taken to push the L-x bits of the current packet which is being transmitted. Each packets transmission delay is given by L/R seconds Therefore, the general expression for the queuing delay is given by n×L/R + (L-x)/R. Based on the data given: the queuing delay = 4×1500 ×8/2M + (750×8)/2M = 0.027 sec 10 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 6) Suppose two hosts, A and B, are separated by 20000 kilometers and are connected by a direct link of 2 Mbps. Suppose the propagation speed over the link is 2.5x108 meters/sec. Answer each sub-question with proper explanation, formulae, units and numerical values. How long does it take to send the file of 800,000 bits from host A to host B, assuming it is sent continuously? Suppose now the file is broken up into packets with each packet containing 40,000 bits. Suppose that each packet is acknowledged by the receiver and the transmission time of an acknowledgment packet is negligible. Finally, assume that the sender cannot send a packet until the preceding one is acknowledged. How long does it take to send the file? 11 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 6) Solution - Time taken to transfer one bit across the link (i.e., propagation delay) is given by dp = d/s =0.08 sec Time taken for host A to push one bit onto the link (i.e., one bit time) is given by τ= 1/R = 1/ = 0.5 µs By the time the first bit has propagated to host B, the number of bits on the link is given by dp/τ = R*dp =160000 bits The transmission delay of the entire file is given by dt = L/R =0.4 sec Total time required to send the file from host A to host B will be dt + dp = 0.48 sec 12 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 6) Solution - Since each packet is transmitted one at a time after acknowledgement is received for the previous packet, the total time taken to transmit the file is given by dtotal = N*(dt’+dp) Here, N = 800000/40000 =20 is the number of packets generated by host A The transmission delay of each packet is given by dt’ = L’/R = = 0.02 sec Hence, dtotal =2 sec 13 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 7) Consider the path from host A to host B traversing three links labeled sequentially. Suppose the rates of links 1, 2 and 3 are 500 kbps, 2 Mbps and 1 Mbps respectively (k=103 and M=106). Assume negligible propagation and processing delays. Suppose packet 1 of size 800 kb and packet 2 of size 500 kb leave A sequentially. Calculate the transmission time of each packet on each link. Calculate the total time taken by the packets to reach B. Explain your calculation. Swap links 1 and 2 and solve the problem. Compare the queuing delay incurred by the 2nd packet with the above problem. 14 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Packe Transmission time on Transmission time on Transmission time on 7) Solution - t link 1 link 2 link 3 1 1.6 s 0.4 s 0.8 s 2 1s 0.25 s 0.5 s Time Status of packet 1 Status of packet 2 (seconds) 1.6 Completed transit on link 1 and begins Begins transmission on link 1 transit on link 2 2 Completed transit on link 2 and begins Still in transit on link 1 transit on link 3 2.6 In transit on link 3 Completed transit on link 1 and begins transit on link 2 2.8 Reached B Still in transit on link 2 2.85 Already at B Completed transit on link 2 and begins transit on link 3 3.35 Already at B Reached B 15 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 7) Solution - In the 1st problem (2nd table in the slide), there was zero queuing delay as 2nd packet always arrived to an empty queue in each router. 2nd problem When the links 1 and 2 are swapped, then the columns of 1st table in the slide are swapped. In this case, packet 1 reaches 1st router at 0.4 seconds. And it takes 1.6 seconds from then onwards to leave the 1st router (i.e., at 2 seconds packet 1 reaches 2nd router). However, while packet 2 is being transmitted packet 1 has reached at 0.65 seconds (i.e., 0.4+0.25) therefore, it has to wait for 1.35 seconds (i.e., time when packet 1 was pushed out minus time when packet 2 arrived = 2 – 0.65 = 1.35 seconds). 16 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 7) Solution - Now examine the 2nd router. Packet 1 is pushed out of 2nd router at 2.8 seconds (i.e., 2+time to push packet 1 on link 3 =2+0.8 =2.8 seconds). Packet 2 is fully received by 2nd router only at 3 seconds (i.e., time when packet 1 was pushed out + time taken to push out packet 2 on link 2 = 2 + 1 = 3). From this we notice that the 2nd packet was ready to be forwarded as soon as it was stored. Therefore, there was no queuing delay. 17 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 7) Solution - So the overall queuing delay is equal to 1.35 seconds which was incurred at 1st router because the incoming rate (2Mbps) is more than the outgoing rate (500kbps). Note that queuing delay is calculated only after all the bits of a packet are fully received (i.e., after the full packet are stored). The queuing delay can be eliminated if the packet transmission is done at a rate of at most 500 kbps (i.e., the lowest link rate along the path between the source and the destination in this example). This can be done by reducing the packet sizes to below 500 kb in this example. For a packet size ≥ 500 kb, throughput is always less than 500 kbps. That is why message segmentation can improve throughput. 18 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Consider the case where end hosts A and B are connected by a one hop router and the links have the same transmission rate R (Mbps). Assume that the host A has P packets of variable length {L1...,LP} bits to transmit to host B. Assume that the processing delays and propagation delays are negligible. Calculate the end-end delay in transmitting P packets. Explain your calculation. Calculate the end-end delay in transmitting P packets via M routers between A and B. All links have the same transmission rate R. Explain your calculation. 19 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Solution of end to end delay with 1 router 20 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Solution of end to end delay with 1 router (contd.) 21 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Solution of end to end delay with M routers 22 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 8) Solution of end to end delay with M routers (contd.) 23 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 9) Consider the case (refer figure below) where clients in a LAN request for objects of size 850,000 bits from web servers over the public internet. The LAN generates 16 requests/second on average. Assume the internet delay (RTT between ISP router and web servers) to be equal to 3 seconds. Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 24 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 9) i) Calculate the total response time assuming negligible time for sending HTTP requests across the LAN and access link. Assume negligible processing delay, transmission delays and propagations delay in the LAN (local area network). 25 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 9) ii) Calculate traffic intensity at the two routers when downloading the objects. iii) At what rate of requesting will packet losses start occurring? [Hint: Total response time = queuing delay at the gateway router + queuing delay at the ISP router + internet delay. Calculate queuing delay as 1/(transmission rate-arrival rate).] 26 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 9) Solution - Based on the given information, the delay in getting the HTTP requests to reach the ISP can be ignored. So the total response time can be approximated to RTT between ISP router and web servers + queuing delay at the ISP router + queuing delay at gateway router. 27 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 9) Solution - Calculation of the queuing delay at the ISP router: Arrival rate at the ISP router is same as that corresponding to the rate of HTTP requests. Length of an object (L) = 850,000 bits. Arrival rate at the ISP router λ1= (16 requests / sec)* (0.85 M bits) = 13.6 Mbps Transmission rate of the ISP router R1 = 15 Mbps. Queuing delay at the ISP router = 1/(R1-λ1) = 0.714 s 28 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 9) Solution - Calculation of the queuing delay at Gateway router: Arrival rate at the gateway router will be same as that at the ISP router as R1>λ1 Transmission rate at the gateway router R2 = 100 Mbps. Queuing delay at the gateway router = 1/(R2-λ1) = 0.01157 µs 29 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems Web servers Clients in LAN Public Internet 100 Mbps 15 Mbps Ethernet switch ISP router Gateway router 9) Solution - Traffic intensity = arrival rate / transmission rate Traffic intensity at the gateway router = λ1/R2 = 0.316 Traffic intensity at the ISP router = λ1 / R1 = 0.91 Packet losses will start occuring when λ1 and R1 becomes equal. So the smallest rate of requests for packet loss to occur is R1 / L = 17.65 requests/sec 30 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 10) Consider the figure below. Now suppose that there are M paths between the server and the client. No two paths share any link. Path k (k = 1,..., M ) consists of N links with transmission rates Rk1, Rk2,..., RkN. If the server can only use one path to send data to the client, what is the maximum throughput that the server can achieve? If the server can use all M paths to send data, what is the maximum throughput that the server can achieve? 31 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 10) Solution - The maximum throughput if only one of the paths can be used is max(min(R11,R12,…,R1N),…..,min(RM1,RM2,…,RMN)) The maximum throughput if all the M paths can be used is min(R11,R12,…,R1N) + min(R21,R22,…,R2N) + …+ min(RM1,RM2,…,RMN) 32 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 11) Suppose that each link between the server and the client has a packet loss probability p, and the packet loss probabilities for these links are independent. What is the probability that a packet (sent by the server) is successfully received by the receiver? 33 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 11) If a packet is lost in the path from the server to the client, then the server will re-transmit the packet. On average, how many times will the server re- transmit the packet in order for the client to successfully receive the packet? 34 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 11) Solution - Given the packet loss probability on a link is given by p. As the packet loss probabilities are given to be independent, the probability that a packet successfully traversed the path is given by P(success) = (1-p)N. P(success in i rounds of transmission) = (1-P(success))i-1 × P(success) = (1- (1-p)N)i-1 (1-p)N. 35 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 11) Solution - As this is a geometric distribution, the mean number of rounds required for success = 1/P(success) Hence, the mean no. of retransmissions (i.e., transmissions excluding the first transmission) = 1/P(success) - 1 36 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 12) Assume that we know the bottleneck link along the path from the server to the client is on the first link at rate Rs bits/sec. Suppose we send a pair of packets back to back from the server to the client, and there is no other traffic on this path. Assume each packet is of size L bits, and both links have the same propagation delay dprop. What is the packet inter-arrival time at the destination? 37 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 12) Solution - The inter-arrival time is L/Rs at the router because the second packet transmission commences only after the last bit of first packet has been pushed out by the server. The propagation delay has no impact here as every bit experiences the same dprop As the bottle neck is link 1 (Rs is smaller than Rc), no queuing delay occurs at the router, so the inter-arrival time remains the same at the client. 38 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 12) Continued Now assume that the second link is the bottleneck link (i.e., Rc < Rs). Is it possible that the second packet queues at the input queue of the second link? Explain. Now suppose that the server sends the second packet T seconds after sending the first packet. How large must T be to ensure no queuing before the transmission on the second link to the client to successfully receive the packet? Explain 39 Computer Communication Networks (UE21EC351A) Unit 1 – Class 10 – Numerical Problems 12) Solution - Second packet arrives at the router at L/Rs + L/Rs + dprop. However, as Rc is less than Rs, the first packet is being transmitted and so second packet has to wait resulting in queuing delay. It takes L/Rs + L/Rc + dprop for the first packet to be pushed out of the router. Therefore, the waiting time for the second packet at the router is departure time of first packet minus arrival time of second packet which is equal to (L/Rs + L/Rc + dprop) – (L/Rs + L/Rs + dprop) = L/Rc – L/Rs. So queuing delay can be avoided at the router if the second packet at the server is transmitted after a delay of at least T = L/Rc – L/Rs 40 COMPUTER COMMUNICATION NETWORKS UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 11 – Protocol layers & their service models Department of Electronics and Communication Engineering 2 Protocol layers and their service Data exchange between two hosts over a communication network is a complex task The complex task is divided into smaller sub-tasks Maintain simplicity for network devices Put burden on the hosts The sub-tasks are completed sequentially The entire process can be visualized as layers arranged top to bottom, where Each layer performs its own unique sub-task On the sender side, each layer waits till the above layer finished its sub-task On the receiver side, each layer waits till the below layer finished its sub-task 3 Protocol layers and their service Communication between two hosts requires the same layers to be implemented in both hosts The peer layers (i.e., sub-task in sender and its counterpart in the receiver) communicate with one other using formatted blocks of data that obey a set of rules or conventions known as a protocol Layers implement protocols in hardware or software Basics requirements of a Protocol: Syntax: Concerns the format of the data blocks Semantics: Includes control information for coordination and error handling Timing: Includes speed matching and sequencing 4 Protocol layers and their service Arranged vertically, the layers on the systems collectively constitute the protocol architecture Two types of protocol architecture were proposed TCP/IP model (Transmission Control Protocol/Internet Protocol) OSI model (Open Systems Interconnect) TCP/IP model or TCP/IP protocol suite Resulted from protocol research under ARPANET (Advanced Research Projects Agency Network) Consists of large collection of protocols issued as Internet standards issued by IAB (Interactive Advertising Bureau) It consists of 5 layers namely, Application layer, Transport (host-to-host) layer, Network layer (IP layer), Link layer (network 5 access layer), Physical layer Protocol layers and their service Application layer : Applications running on hosts generate/receive data Data is referred to as message A process initiates communication with another by sending a query/request Message is formatted according to the application layer protocol Messages can be big in size Applications can have QoS(Quality of Service) requirements 6 Protocol layers and their service Transport layer: Responsible for providing QoS for messages Performs multiplexing at the sender Performs demultiplexing at the receiver Maps each message to a corresponding process Appends a new header to each message Message plus header is called segment 7 Protocol layers and their service Network layer: Fragments segments into packets Moves packets hop-by-hop E.g., router to router Uses source and destination IP(Internet Protocol) addresses Path between source host and destination host is discovered Appends a new header to each packet Packet plus header is called datagram 8 Protocol layers and their service Link layer: Pushes the packets onto a link Using link layer protocols Can forward frames using MAC(Media Access Control) address Appends a new header to the packet Packet plus header is called frame Provides synchronization at receiver Checks for errors in frame 9 Protocol layers and their service Physical layer: Provides physical interface between the host and the link Example: Modem and Ethernet card, wireless adapter Converts binary data into signals Performs modulation and demodulation Performs transmission, reception and filtering of signals 10 Protocol layers and their service Encapsulation happens before departure Decapsulation happens after arrival Encapsulation Decapsulation 11 COMPUTER COMMUNICATION NETWORKS UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 12 – Principles of Network Applications Department of Electronics and Communication Engineering 2 Unit 1 – Class 12 - Principles of network applications Applications run on end-systems (e.g., computers, servers) Examples: Skype, Whatsapp, Apple Pay, Youtube, Netflix Application developers often build a pair of programs which are coded in C, Java or Python One program is referred to as client program while the other is referred to a server program (e.g., web browser and web server program) These programs are also referred to as processes From the application developer’s perspective, the network architecture is fixed and provides a specific set of services to applications. 3Services: Reliability, throughput, security, timing, etc. Unit 1 – Class 12 - Principles of network applications Application architecture dictates how the application developer views the interaction between the applications running on the end-systems 4 Unit 1 – Class 12 - Principles of network applications Client-server architecture Client initiates the process communication Server responds to requests from the clients Server is always ON – a client can contact the server by sending a packet to the server’s IP address Server is well defined (e.g., IP address) Server can handle concurrent connections (concurrent – Parallel) Examples: Search engines, Internet commerce, Web- based email, Social media Applications with a client-server architecture – Web, FTP, Telnet & e-mail 5 Unit 1 – Class 12 - Principles of network applications Client-server architecture Often in a client-server application, a single-server host is incapable of keeping up with all the requests from clients. For example, a popular social-networking site can quickly become overwhelmed if it has only one server handling all of its requests. For this reason, a data center, housing a large number of hosts, is often used to create a powerful virtual server. 6 Unit 1 – Class 12 - Principles of network applications Client-server architecture The most popular Internet services—such as search engines (e.g., Google, Bing, Baidu), Internet commerce (e.g., Amazon, eBay, Alibaba), Web-based e-mail (e.g., Gmail and Yahoo Mail), social media (e.g., Facebook, Instagram, Twitter, and WeChat)—run in one or more data centers. Google has 19 data centers distributed around the world, which collectively handle search, YouTube, Gmail, and other services. A data center can have hundreds of thousands of servers, which must be powered and maintained. Additionally, the service providers must pay recurring interconnection and bandwidth costs for sending data 7 from their data centers Unit 1 – Class 12 - Principles of network applications Peer-to-peer architecture Any host can send and receive data Hosts can join and leave the network any time Hosts allocate resources to help each other P2P architectures are self scalable – although each peer generates workload by requesting files, each peer also adds service capacity to the system by distributing files to other peers Distributed algorithms are used for a) Maintaining state information and b) For file sharing Examples: Bit Torrent, Skype 8 Unit 1 – Class 12 - Principles of network applications Peer-to-peer architecture P2P architectures are also cost effective, since they normally don’t require significant server infrastructure and server bandwidth (in contrast with clients-server designs with datacenters). However, P2P applications face challenges of security, performance, and reliability due to their highly decentralized structure. 9 Unit 1 – Class 12 - Principles of network applications Client & Server Processes In Web application a client browser process exchanges messages with a Web server process. In a P2P file-sharing system, a file is transferred from a process in one peer to a process in another peer. With the Web, a browser is a client process and a Web server is a server process. With P2P file sharing, the peer that is downloading the file is labeled as the client, and the peer that is uploading the file is labeled as the server. 10 Unit 1 – Class 12 - Principles of network applications Client & Server Processes You may have observed that in some applications, such as in P2P file sharing, a process can be both a client and a server. Indeed, a process in a P2P file-sharing system can both upload and download files. We define the client and server processes as follows: “In the context of a communication session between a pair of processes, the process that initiates the communication (that is, initially contacts the other process at the beginning of the session) is labeled as the client. The process that waits to be contacted to begin the session is the server” 11 Processes communicating Processes exchange messages with one another using the rules governed by the end-systems operating system How to read/write a message? When to read/write a message? 12 Processes communicating Figure illustrates socket communication between two processes that communicate over the Internet. Figure assumes that the underlying transport protocol used by the processes is the Internet’s TCP protocol. As shown in this figure, a socket is the interface between the application layer and the transport layer within a host. It is also referred to as the Application Programming Interface (API) between the application and the network, since the socket is the programming interface with which network applications are built. 13 Processes communicating The application developer has control of everything on the application-layer side of the socket but has little control of the transport-layer side of the socket. The only control that the application developer has on the transport layer side is (1) the choice of transport protocol and (2) perhaps the ability to fix a few transport-layer parameters such as maximum buffer and maximum segment sizes. Once the application developer chooses a transport protocol (if a choice is available), the application is built using the transport-layer services provided by that protocol. 14 Transport layer services 15 Transport layer services Applications and the supported protocols 16 Application–layer protocols Application layer protocols define the following The types of messages exchanged, for example, request messages and response messages The syntax of the various message types, such as the fields in the message and how the fields are delineated The semantics of the fields, that is, the meaning of the information in the fields Rules for determining when and how a process sends messages and responds to messages. 17 COMPUTER COMMUNICATION NETWORKS (UE22EC351A) UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 13 – Web & HTTP : Overview, Non-persistent & Persistent Department of Electronics and Communication Engineering 2 Unit 1 – Class 13 - Web and HTTP: Overview Web servers store objects embedded in HTML (Hyper Text Markup Language) pages The primary object (i.e., HTML page) is called webpage Web applications communicate using the HTTP (Hyper Text Transfer Protocol) Client fetches a webpage using a web browser (also known as client process) Client process sends a HTTP request message specifying the object requested (also known as Uniform Resource Locator) Web server process sends a HTTP response message which may contain the requested object Web browser: Microsoft Edge, Google Chrome, etc. Web server: Apache, Microsoft Internet Information Server, etc. HTTP 3 is a stateless protocol Unit 1 – Class 13 - Web and HTTP: Overview HTTP request-response behaviour What transport layer protocol is used? How many ways can the request and response happen? 1. Persistent TCP 2. Non-persistent TCP 4 Unit 1 – Class 13 - Web and HTTP: Non-persistent Separate TCP connection to fetch each object (including base webpage) Assume negligible size for HTTP request message Total access delay per object = Transmission delay at the server + 2 × RTT (RTT – Round Trip Time) Socket number of web server is 80 Used in HTTP/1.0 5 Unit 1 – Class 13 - Web and HTTP: Persistent Compared to non-persistent connections, in persistent HTTP we save total access time and the efforts in establishing TCP connections For each of these connections, TCP buffers must be allocated and TCP variables must be kept in both the client and server. In persistent HTTP connection, only one TCP connection is established (for base webpage) and all objects are fetched back-to-back Server closes connection after some specified time of inactivity Used in HTTP/1.1 (allows up to 6 parallel TCP connections) Used in HTTP/2 (includes multiplexing, message prioritization and server pushing) 6 Unit 1 – Class 13 - Web and HTTP Numerical #7: Consider accessing the webpage ww.someSchool.edu/someDepartment/Schoolpage.html which contains two embedded objects. Suppose the Web server and client are connected by a long link of rate R. Let RTT denote the two way propagation delay. Suppose the length (bits) of the webpage and two objects are L1, L2 and L3 respectively. Suppose the HTTP request message is of negligible length and can be piggybacked with acknowledgements. Calculate separately, the total access delay under a persistent TCP connection and non- persistent TCP connections. Show the timing diagram. 7 Unit 1 – Class 13 - Web and HTTP Numerical #7 – Solution – i) For persistent connection and serial downloading of embedded objects, access delay = 4 RTT + (L1+L2+L3)/R ii) For persistent connection and parallel downloading of embedded objects, access delay = 3 RTT + L1/R + max( L2/R , L3/R ) iii) For non-persistent connection and serial downloading of embedded objects, access delay = 6 RTT + (L1+L2+L3)/R iv) For non-persistent connection and parallel downloading of embedded objects, access delay = 4 RTT + L1/R + max( L2/R , L3/R ) 8 Unit 1 – Class 13 - Web and HTTP Numerical #8 i) Suppose a webpage containing one embedded object has to be fetched by the client using persistent connection. Assume all objects have a size of L bits. Assume the HTTP requests are negligible in size. Let R denote the mean throughput of the connection. Denote the round trip time between the client & proxy server as RTT1. Denote the round trip time between the proxy server and the origin server as RTT2. Answer the following questions 1) How much time would the client take to access and fetch the webpage if the objects are cached at the proxy server? 2) How much time would the client take to access and fetch the webpage if the objects are not cached at the proxy server? 9 Unit 1 – Class 13 - Web and HTTP Numerical #8 – Solution i) Case 1 – Cached at the proxy server Access delay = 3*RTT1+2*L/R --- 1 RTT for TCP handshake,1 RTT for base HTML & 1 RTT for embedded object; one L/R each for embedded object & HTML page ii) Case 2 – Not cached at the proxy server Access delay = 3*RTT1+3*RTT2+4*L/R – Same as above plus client has to wait for the object to be downloaded by the proxy server from the origin server. Note that proxy server performs store & forward operation (i.e acts as a relay) 10 COMPUTER COMMUNICATION NETWORKS (UE22EC351A) UNIT 1: INTERNET ARCHITECTURE AND APPLICATIONS – Class 14 – Web & HTTP – Message Formats Department of Electronics and Communication Engineering 2 Unit 1 – Class 14 - Web and HTTP: Message format - Typical HTTP Request message 3 Unit 1 – Class 14 - Web and HTTP: Message format HTTP Request message Entity body is empty (download) or non-empty (upload) 4 Unit 1 – Class 14 - Web and HTTP: Message format - HTTP Request message – Request line - The first line of an HTTP request message is called the request line; - the subsequent lines are called the header lines. - The request line has three fields: the method field, the URL field, and the HTTP version field. - The method field can take on several different values, including GET, POST, HEAD, PUT, and DELETE. - The great majority of HTTP request messages use the GET method. The GET method is used when the browser requests an object, with the requested object identified in the URL field. 5 Unit 1 – Class 14 - Web and HTTP: Message format - HTTP Request message – Header line - Now let’s look at the header lines in the example. - The header line Host: www.someschool.edu specifies the host on which the object resides. - You might think that this header line is unnecessary, as there is already a TCP connection in place to the host. But, the information provided by the host header line is required by Web proxy caches. - By including the Connection: close header line, the browser is telling the server that it doesn’t want to bother with persistent connections; it wants the server to close the connection after sending the requested object. 6 Unit 1 – Class 14 - Web and HTTP: Message format - HTTP Request message – Header line - The User-agent: header line specifies the user agent, that is, the browser type that is making the request to the server. - Here the user agent is Mozilla/5.0, a Firefox browser. - This header line is useful because the server can actually send different versions of the same object to different types of user agents. (Each of the versions is addressed by the same URL.) 7 Unit 1 – Class 14 - Web and HTTP: Message format - HTTP Request message – Header line - Finally, the Accept-language: header indicates that the user prefers to receive a French version of the object, if such an object exists on the server; otherwise, the server should send its default version. - The Accept-language: header is just one of many content negotiation headers available in HTTP. 8 Unit 1 – Class 14 - Web and HTTP: Message format - HTTP Request message – Header line - You may have noticed, however, that after the header lines (and the additional carriage return and line feed) there is an “entity body.” - The entity body is empty with the GET method, but is used with the POST method. - An HTTP client often uses the POST method when the user fills out a form—for example, when a user provides search words to a search engine. 9 Unit 1 – Class 14 - Web and HTTP: Message format - HTTP Request message – Header line - With a POST message, the user is still requesting a Web page from the server, but the specific contents of the Web page depend on what the user entered into the form fields. If the value of the method field is POST, then the entity body contains what the user entered into the form fields. 10 Unit 1 – Class 14 - Web and HTTP: Message format Example-GET message: Request webpage www.gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark- file.html 11 Unit 1 – Class 14 - Web and HTTP: Message format Example-GET message (contd.): Inspecting the raw data of the TCP segment 12 Unit 1 – Class 14 - Web and HTTP: Message format - Typical HTTP Response Message 13 Unit 1 – Class 14 - Web and HTTP: Message format - Typical HTTP Response Message - Let’s take a careful look at this response message. - It has three sections: an initial status line, six header lines, and then the entity body. - The entity body is the meat of the message—it contains the requested object itself (represented by data data data data data - The status line has three fields: the protocol version field, a status code, and a corresponding status message. 14 Unit 1 – Class 14 - Web and HTTP: Message format - Typical HTTP Response Message - In this example, the status line indicates that the server is using HTTP/1.1 and that everything is OK (that is, the server has found, and is sending, the requested object). - Now let’s look at the header lines. The server uses the Connection: close header line to tell the client that it is going to close the TCP connection after sending the message. - The Date: header line indicates the time and date when the HTTP response was created and sent by the server. 15 Unit 1 – Class 14 - Web and HTTP: Message format - Typical HTTP Response Message - Note that this is not the time when the object was created or last modified; it is the time when the server retrieves the object from its file system, inserts the object into the response message, and sends the response message. - The Server: header line indicates that the message was generated by an Apache Web server; it is analogous to the User-agent: header line in the HTTP request message. 16 Unit 1 – Class 14 - Web and HTTP: Message format - Typical HTTP Response Message - The Last-Modified: header line indicates the time and date when the object was created or last modified. - The Last-Modified: header, which we will soon cover in more detail, is critical for object caching, both in the local client and in network cache servers (also known as proxy servers). - The Content-Length: header line indicates the number of bytes in the object being sent. The Content-Type: header line indicates that the object in the entity body is HTML text. (The object type is officially indicated by the Content-Type: header and not by the file extension.) 17 Unit 1 – Class 14 - Web and HTTP: Message format - Common Status Codes - 200 OK – Request Succeeded & the information is returned in the response - 301 Moved Permanently: Requested object has been permanently moved; the new URL is specified in Location: header of the response message. The client software will automatically retrieve the new URL - 400 Bad Request: This is a generic error code indicating that the request could not be understood by the server. - 404 Not Found: The requested document does not exist on this server 18 Unit 1 – Class 14 - Web and HTTP: Message format - Common Status Codes - 505 HTTP Version Not Supported: The requested HTTP protocol version is not supported by the server. 19 Unit 1 – Class 14 - Web and HTTP: Message format Web server sends the response message which could have the requested object 20 Unit 1 – Class 14 - Web and HTTP: Message format Example-HTTP response message: 21 Unit 1 – Class 14 - Web and HTTP: Message format Example-HTTP response (contd.): 22 Unit 1 – Class 14 - Web and HTTP: Message format Consider the HTTP messages exchanged between the client (web browser) and the web server as given below. 23 Unit 1 – Class 14 - Web and HTTP: Message format Answer the following questions: (1 mark each) 1. What is the "method" used by the client? 2. What is name of the object requested by the client? 3. What is the name of the web server on which the object is to be located? 4. What is the type of TCP connection preferred by the client? 5. What are the status code and phrase returned by the web server? 6. What is the version of HTTP supported by the web server? 7. What is the time at which the HTTP message was generated by the web server? 8. When was the object last updated at the web server? 9. What is the size of object sent by the web server? 10. What is the server process used by the web-server? 24 Unit 1 – Class 14 - Web and HTTP: Message format Solution – 1. GET 2. lab2-3.html 3. gaia.cs.umass.edu 4. Persistent (keep alive) 5. 200 and OK 6. HTTP 1.1 7. Tue, 23 Sep 2003 5:37:02 GMT 8. Tue, 23 Sep 2003 5:37:01 GMT 9. 4500 bytes 10. Apache /2.0.40 25 Computer Communication Networks (UE22EC351A) Unit 1 – Internet Architecture & Applications – Class 15 – Web & HTTP – Numerical Problems – Part 1 Prof. Rajesh. C Department of ECE, PESU-EC Campus 2 Computer Communication Networks (UE21EC351A) Unit 1 – Class 15 – Web & HTTP – Numerical Problems – Part 1 - Numerical 1 – - Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1,..., RTTn. Further suppose that the Web page associated with the link contains exactly one object, consisting of a small amount of HTML text. Let RTT0 denote the RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the object? 3 - I Computer Communication Networks (UE21EC351A) Unit 1 – Class 15 – Web & HTTP – Numerical Problems – Part 1 - Numerical 1 - - Solution – - Total elapsed time = Delay accessing n DNS servers recursively + RTT due to TCP connection establishment + RTT due to HTTP request-response = Σi=1n RTTi +2 RTT0 4 Computer Communication Networks (UE21EC351A) Unit 1 – Class 15 – Web & HTTP – Numerical Problems – Part 1 - Numerical 2 - - Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1,..., RTTn. Suppose the HTML file references eight very small objects on the same server. Neglecting transmission times, how much time elapses with 1. Non-persistent HTTP with no parallel TCP connections? 2. Non-persistent HTTP with the browser configured for 5 parallel connections? 3. Persistent HTTP (no parallel connections)? 5 Computer Communication Networks (UE21EC351A) Unit 1 – Class 15 – Web & HTTP – Numerical Problems – Part 1 - Numerical 2 - - Solution - - 1) Non-persistent with no parallel connections : Σi=1n RTTi +2 RTT0 + 16 RTT0 - The first two terms as before. The 3rd term is equal to No. of objects * (RTT due to TCP handshake + RTT due to HTTP request-response) - 2) Non-persistent with 5 parallel connections : Σi=1n RTTi +2 RTT0 + 4 RTT0 - The first two terms as before. First 5 out of the 8 objects can be downloaded in parallel and then the remaining 3 objects can be downloaded in parallel. Each object is downloaded after establishing a separate TCP connection. Hence, we get the 3rd term 4 RTT0 6 Computer Communication Networks (UE21EC351A) Unit 1 – Class 15 – Web & HTTP – Numerical Problems – Part 1 - Numerical 2 - - Solution - - 3) Persistent with no parallel connections : Σi=1n RTTi +2 RTT0 + 8 RTT0 - The first two terms as before. The TCP connection has been established for the HTML file already. As we are dealing with persistent connection, we request each object on the existing TCP connection. Hence the 3rd term is simply No. of objects multiplied with the RTT due to HTTP request-response. 7 Computer Communication Networks (UE21EC351A) - Numerical 3 - - Draw a simple timing diagram indicating the delays involved in retrieving a web page containing the base HTML object and 4 additional images using (i) Persistent HTTP (ii) Non-persistent HTTP and (iii) Persistent HTTP with three parallel connections. Assume size of all objects to be negligible. Express total delay in terms of RTT. 8 Computer Communication Networks (UE21EC351A) Unit 1 – Class 15 – Web & HTTP – Numerical Problems – Part 1 - Numerical 3 - - Solution – 9 Computer Communication Networks (UE22EC351A) Unit 1 – Internet Architecture & Applications – Class 19 – Web & HTTP – Numerical Problems – Part 2 Prof. Rajesh. C Department of ECE, PESU-EC Campus 2 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 1 – - Consider accessing the webpage ww.someSchool.edu/someDepartment/Schoolpage.html which contains two embedded objects. Suppose the Web server and client are connected by a long link of rate R. Let RTT denote the two way propagation delay. Suppose the length (bits) of the webpage and two objects are L1, L2 and L3 respectively. Suppose the HTTP request message is of negligible length and can be piggybacked with acknowledgements. Calculate separately, the total access delay under a persistent TCP connection and non-persistent TCP connections. Show the timing diagram. 3 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 1 – - Solution – - i) For persistent connection and serial downloading of embedded objects, access delay = 4 RTT + (L1+L2+L3)/R. - ii) For persistent connection and parallel downloading of embedded objects, access delay = 3 RTT + L1/R + max( L2/R , L3/R ) - iii) For non-persistent connection and serial downloading of embedded objects, access delay = 6 RTT + (L1+L2+L3)/R. - iv) For non-persistent connection and parallel downloading of embedded objects, access delay = 4 RTT + L1/R + max( L2/R , L3/R ) 4 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 2 – - Draw a simple timing diagram indicating the delays involved in retrieving a web page containing the base HTML object and 3 additional images using (i) Persistent HTTP (ii) Non-persistent HTTP and (iii) Persistent HTTP with three parallel connections. - Assume size of all objects to be negligible. Express total delay in terms of RTT. 5 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 2 – 6 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 3 – - Consider a 30-meter link, over which a sender can transmit at a rate of 300 bits/sec in both directions. Suppose that packets containing data are 10,000 bits long, and packets containing only control (e.g ACK or handshaking) are 200 bits long. Assume that N parallel connections each get 1/N of the link bandwidth. Now, consider the HTTP protocol and suppose that each download object is 100 Kbits long, and that the initial downloaded object contains 10 referenced objects from the same sender. Would parallel downloads via parallel instances of non-persistent HTTP make sense in this case? Now consider persistent HTTP. Do you expect significant gains over the non-persistent case? Justify & explain your answer ? 7 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 4 – - Consider the figure given below. Suppose the client requests and serially downloads a HTML page having three embedded objects. - Let RTT represent the round trip time. - Assume any HTTP request is of size L bits. Assume every object (including the HTML file) is of size M bits. - Draw a timing diagram and calculate the total download time under the persistent connection. 8 Computer Communication Networks (UE22EC351A) Unit 1 – Class 19 – Web & HTTP – Numerical Problems – Part 2 - Numerical 4 – Solution - Download time = 5 RTT + 4(L+M)/R + 4(L+M)/R 9 Computer Communication Networks (UE22EC351A) Unit 1 – Internet Architecture & Applications – Class 20 – Web & HTTP – Cookies & Web caching – Text book – Reference – Section 2.2.4 – 2.2.5 – pages – 135 to 142 Prof. Rajesh. C Department of ECE, PESU-EC Campus 2 Computer Communication Networks (UE22EC351A) Unit 1 – Class 20 – Web & HTTP – Cookies & Web Caching - We mentioned above that an HTTP server is stateless. - This simplifies server design and has permitted engineers to develop high-performance Web servers that can handle thousands of simultaneous TCP connections. - However, it is often desirable for a Web site to identify users, either because the server wishes to restrict user access or because it wants to serve content as a function of the user identity. - For these purposes, HTTP uses cookies. Cookies, defined in [RFC 6265], allow sites to keep track of users. Most major commercial Web sites use cookies today 3 Computer Communication Networks (UE22EC351A) Unit 1 – Class 20 – Web & HTTP – Cookies & Web Caching 4 Computer Communication Networks (UE22EC351A) Unit 1 – Class 20 – Web & HTTP – Cookies & Web Caching - Step 1 - Suppose Susan, who always accesses the Web using Internet Explorer from her home PC, contacts Amazon.com for the first time. - Let us suppose that in the past she has already visited the eBay site. - When the request comes into the Amazon Web server, the server creates a unique identification number and creates an entry in its back-end database that is indexed by the identification number. - Step 2 - The Amazon Web server then responds to Susan’s browser, including in the HTTP response a Set-cookie: header, which contains the identification number. - For example, the header line might be: Set-cookie: 1678 5 Computer Communication Networks (UE22EC351A) Unit 1 – Class 20 – Web & HTTP – Cookies & Web Caching - When Susan’s browser receives the HTTP response message, it sees the Set-cookie: header. - Step 3 - The browser then appen