computer communication networks foundation
play

Computer Communication Networks Foundation ICEN/ICSI 416 Fall - PowerPoint PPT Presentation

Computer Communication Networks Foundation ICEN/ICSI 416 Fall 2016 Prof. Dola Saha 1 Foundation Applications Requirements Network Architecture Implementing Network Software Performance 2 Goals Exploring the requirements


  1. Packet Switching: queueing delay, loss C R = 100 Mb/s A D R = 1.5 Mb/s B E queue of packets waiting for output link queuing and loss: v If arrival rate (in bits) to link exceeds transmission rate of link for a period of time: § packets will queue, wait to be transmitted on link § packets can be dropped (lost) if memory (buffer) fills up 28

  2. Two key network-core functions routing: determines source- forwarding : move packets from destination route taken by packets router’s input to appropriate router § routing algorithms output routing algorithm local forwarding table header value output link 1 0100 3 0101 2 2 0111 2 3 1001 1 dest address in arriving packet’s header Network Layer 29

  3. Alternative core: circuit switching end-end resources allocated to, reserved for “call” between source & dest: Ø In diagram, each link has four circuits. § call gets 2 nd circuit in top link and 1 st circuit in right link. Ø dedicated resources: no sharing § circuit-like (guaranteed) performance Ø circuit segment idle if not used by call (no sharing) Ø Commonly used in traditional telephone networks 30

  4. Circuit switching: FDM versus TDM Example: FDM 4 users frequency time TDM frequency time 31

  5. Packet switching versus circuit switching packet switching allows more users to use network! example: § 1 Mb/s link N § each user: ….. users • 100 kb/s when “active” 1 Mbps link • active 10% of time circuit-switching: 10 users Q: how did we get value 0.0004? packet switching: Q: what happens if > 35 users ? with 35 users, probability > 10 active at same time is less than .0004 * 32

  6. Packet switching versus circuit switching is packet switching a “slam dunk winner?” great for bursty data resource sharing simpler, no call setup excessive congestion possible: packet delay and loss protocols needed for reliable data transfer, congestion control Q: How to provide circuit-like behavior? bandwidth guarantees needed for audio/video apps still an unsolved problem Q: human analogies of reserved resources (circuit switching) versus on- demand allocation (packet-switching)? 33

  7. Internet structure: network of networks Ø End systems connect to Internet via access ISPs (Internet Service Providers) § Residential, company and university ISPs Ø Access ISPs in turn must be interconnected. § So that any two hosts can send packets to each other Ø Resulting network of networks is very complex § Evolution was driven by economics and national policies Ø Let’s take a stepwise approach to describe current Internet structure 34

  8. Internet structure: network of networks Question: given millions of access ISPs, how to connect them together? … … access access net net access net access net access net access access net net … access access net net access net access net access net access … net access … access net net access net 35

  9. Internet structure: network of networks Option: connect each access ISP to every other access ISP? … … access access net net access net access net access … net access access net net connecting each access ISP to each … other directly doesn’t scale: O ( N 2 ) access access … connections. net net access net access net access net access … net access … access net net access net 36

  10. Internet structure: network of networks Option: connect each access ISP to a global transit ISP? Customer and provider ISPs have economic agreement. … … access access net net access net access net access net access access net net … global ISP access access net net access net access net access net access … net access … access net net access net 37

  11. Internet structure: network of networks But if one global ISP is viable business, there will be competitors …. … … access access net net access net access net access net access access net ISP A net … access access ISP B net net ISP C access net access net access net access … net access … access net net access net 38

  12. Internet structure: network of networks But if one global ISP is viable business, there will be competitors …. which must be interconnected Internet exchange point … … access access net net access net access net access net IXP access access net ISP A net … IXP access access ISP B net net ISP C access net access net peering link access net access … net access … access net net access net 39

  13. Internet structure: network of networks … and regional networks may arise to connect access nets to ISPS … … access access net net access net access net access net IXP access access net ISP A net … IXP access access ISP B net net ISP C access net access net access regional net net access … net access … access net net access net 40

  14. Internet structure: network of networks … and content provider networks (e.g., Google, Microsoft, Akamai ) may run their own network, to bring services, content close to end users … … access access net net access net access net access net IXP access access net ISP A net … Content provider network IXP access access ISP B net net ISP B access net access net access regional net net access … net access … access net net access net 41

  15. Internet structure: network of networks Tier 1 ISP Tier 1 ISP Google IXP IXP IXP Regional ISP Regional ISP access access access access access access access access ISP ISP ISP ISP ISP ISP ISP ISP at center: small # of well-connected large networks Ø § “tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coverage § content provider network (e.g, Google): private network that connects it data centers to Internet, often bypassing tier-1, regional ISPs 42

  16. Tier-1 ISP: e.g., Sprint POP: point-of-presence to/from backbone peering … … … … … to/from customers 43

  17. Support for Common Services Ø Logical Channels § Application-to-Application communication path or a pipe Process communicating over an abstract channel 44

  18. Common Communication Patterns Ø Client/Server Ø Two types of communication channel § Request/Reply Channels § Message Stream Channels 45

  19. Reliability Ø Network should hide the errors Ø Bits are lost § Bit errors (1 to a 0, and vice versa) § Burst errors – several consecutive errors Ø Packets are lost (Congestion) Ø Links and Node failures Ø Messages are delayed Ø Messages are delivered out-of-order Ø Third parties eavesdrop 46

  20. Network Architecture Example of a layered network system 47

  21. Network Architecture Layered system with alternative abstractions available at a given layer 48

  22. What is a protocol? Ø Human Protocols: Ø Network Protocols: § What’s the time? § Nodes / machines in the network participate § I have a question…. § Communication activity in § Hi, I am XYZ…. Internet is governed by § Hello, how are you? Network Protocols § Are you alive? § Do you know the route to node X? Protocols define format, order of messages sent and received among network entities, and actions taken on message transmission, receipt 49

  23. What is a protocol? Ø Human Protocols: Ø Network Protocols: Hi TCP connection request Hi TCP connection response Got the Get http://www.albany.edu/faculty/dsaha/ time? 2:00 <file> time 50

  24. Protocols Ø Protocol defines the interfaces between the layers in the same system and with the layers of peer system Ø Building blocks of a network architecture Ø Each protocol object has two different interfaces § service interface: operations on this protocol § peer-to-peer interface: messages exchanged with peer Ø Term “protocol” is overloaded § specification of peer-to-peer interface § module that implements this interface 51

  25. Interfaces Service and Peer Interfaces 52

  26. Protocols Ø Protocol Specification: prose, pseudo-code, state transition diagram Ø Interoperable: when two or more protocols that implement the specification accurately Ø IETF: Internet Engineering Task Force 53

  27. Protocol Graph Example of a protocol graph nodes are the protocols and links the “depends-on” relation 54

  28. Protocol Layers Ø Networks are complex, with many “pieces”: § hosts § routers § links of various media § applications § protocols § hardware, software Question: is there any hope of organizing structure of network? 55

  29. Organization of air travel ticket (complain) ticket (purchase) baggage (claim) baggage (check) gates (unload) gates (load) runway landing runway takeoff airplane routing airplane routing airplane routing 56

  30. Layering of airline functionality ticket (purchase) ticket (complain) ticket baggage (check) baggage (claim baggage gates (load) gates (unload) gate runway (takeoff) runway (land) takeoff/landing airplane routing airplane routing airplane routing airplane routing airplane routing departure intermediate air-traffic arrival airport control centers airport Ø layers : each layer implements a service § via its own internal-layer actions § relying on services provided by layer below 57

  31. Why layering? Ø dealing with complex systems: § explicit structure allows identification, relationship of complex system’s pieces o layered reference model for discussion Ø modularization eases maintenance, updating of system § change of implementation of layer’s service transparent to rest of system § e.g., change in gate procedure doesn’t affect rest of system Ø layering considered harmful? 58

  32. OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection 59

  33. Description of Layers Ø Physical Layer § Handles the transmission of raw bits over a communication link Ø Data Link Layer § Collects a stream of bits into a larger aggregate called a frame § Network adaptor along with device driver in OS implement the protocol in this layer § Frames are actually delivered to hosts Ø Network Layer § Handles routing among nodes within a packet-switched network § Unit of data exchanged between nodes in this layer is called a packet The lower three layers are implemented on all network nodes 60

  34. Description of Layers Ø Transport Layer § Implements a process-to-process channel § Unit of data exchanges in this layer is called a message Ø Session Layer § Provides a name space that is used to tie together the potentially different transport streams that are part of a single application Ø Presentation Layer § Concerned about the format of data exchanged between peers Ø Application Layer § Standardize common type of exchanges The transport layer and the higher layers typically run only on end-hosts and not on the intermediate switches and routers 61

  35. Internet Protocol Stack Ø application: supporting network applications § FTP, SMTP, HTTP application Ø transport: process-process data transfer § TCP, UDP transport Ø network: routing of datagrams from source network to destination § IP, routing protocols link Ø link: data transfer between neighboring physical network elements § Ethernet, 802.11 (WiFi) Ø physical: bits “on the wire” / “over the air” 62

  36. Encapsulation High-level messages are encapsulated inside of low-level messages 63

  37. Encapsulation message M application segment transport H t H t M network datagram H n H n H t M link frame H l H n H t M physical source link physical switch destination H n H t network M M application link H l H n H t M H n H t M transport H t M physical network H n H t M link H l H n H t M router physical 64

  38. Internet Architecture Alternative view of the Internet architecture. The “Network” layer shown here is sometimes referred to Internet Protocol Graph as the “sub-network” or “link” layer. 65

  39. Internet Architecture Ø Defined by IETF (The Internet Engineering Task Force) Ø Three main features § Does not imply strict layering. The application is free to bypass the defined transport layers and to directly use IP or other underlying networks § An hour-glass shape – wide at the top, narrow in the middle and wide at the bottom. IP serves as the focal point for the architecture § In order for a new protocol to be officially included in the architecture, there needs to be both a protocol specification and at least one (and preferably two) representative implementations of the specification 66

  40. Application Programming Interface Ø Interface exported by the network Ø Since most network protocols are implemented (those in the high protocol stack) in software and nearly all computer systems implement their network protocols as part of the operating system, when we refer to the interface “ exported by the network ”, we are generally referring to the interface that the OS provides to its networking subsystem Ø The interface is called the network Application Programming Interface (API) 67

  41. Application Programming Interface (Sockets) Ø Socket Interface was originally provided by the Berkeley distribution of Unix § Now supported in virtually all operating systems Ø Each protocol provides a certain set of services , and the API provides a syntax by which those services can be invoked in this particular OS 68

  42. Socket Ø What is a socket? § The point where a local application process attaches to the network § An interface between an application and the network § An application creates the socket Ø The interface defines operations for § Creating a socket § Attaching a socket to the network § Sending and receiving messages through the socket § Closing the socket 69

  43. Sockets Ø process sends/receives messages to/from its socket Ø socket analogous to door between application process & end- end-transport § sending process shoves message out door § sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process application application socket controlled by process process app developer transport transport controlled network network by OS link Internet link physical physical 70

  44. Socket programming Two socket types for two transport services: § UDP: unreliable datagram § TCP: reliable, byte stream-oriented Application Example: 1. client reads a line of characters (data) from its keyboard and sends data to server 2. server receives the data and converts characters to uppercase 3. server sends modified data to client 4. client receives modified data and displays line on its screen 71

  45. Socket programming with UDP UDP: no “ connection ” between client & server Ø no handshaking before sending data Ø sender explicitly attaches IP destination address and port # to each packet Ø receiver extracts sender IP address and port# from received packet UDP: transmitted data may be lost or received out-of-order Application viewpoint: Ø UDP provides unreliable transfer of groups of bytes ( “ datagrams ” ) between client and server 72

  46. Client/server socket interaction: UDP client server (running on serverIP ) create socket: create socket, port= x: clientSocket = serverSocket = socket(AF_INET,SOCK_DGRAM) socket(AF_INET,SOCK_DGRAM) Create datagram with server IP and port=x; send datagram via read datagram from clientSocket serverSocket write reply to read datagram from serverSocket clientSocket specifying client address, close port number clientSocket 73

  47. Example app: UDP client Python UDPClient include Python’s socket from socket import * library serverName = ‘hostname’ serverPort = 12000 clientSocket = socket(AF_INET, create UDP socket for server SOCK_DGRAM) message = raw_input(’Input lowercase sentence:’) get user keyboard input clientSocket.sendto (message.encode(), Attach server name, port to (serverName, serverPort)) message; send into socket modifiedMessage, serverAddress = clientSocket.recvfrom(2048) read reply characters from socket into string print modifiedMessage.decode() clientSocket.close() print out received string and close socket 74

  48. Example app: UDP server Python UDPServer from socket import * serverPort = 12000 serverSocket = socket(AF_INET, SOCK_DGRAM) create UDP socket serverSocket.bind(('', serverPort)) bind socket to local port number 12000 print ( “ The server is ready to receive ”) while True: loop forever message, clientAddress = serverSocket.recvfrom(2048) modifiedMessage = message.decode().upper() Read from UDP socket into message, getting client’s address serverSocket.sendto(modifiedMessage.encode(), (client IP and port) clientAddress) send upper case string back to this client 75

  49. Socket programming with TCP client must contact server when contacted by client, server Ø TCP creates new socket for server server process must first be Ø process to communicate with that running particular client server must have created socket Ø § allows server to talk with multiple (door) that welcomes client ’ s clients contact § source port numbers used to client contacts server by: distinguish clients (more in Chap Creating TCP socket, specifying IP 3) Ø address, port number of server application viewpoint: process TCP provides reliable, in-order when client creates socket: client Ø byte-stream transfer ( “ pipe ” ) TCP establishes connection to between client and server server TCP 76

  50. Client/server socket interaction: TCP client server (running on hostid ) create socket, port= x , for incoming request: serverSocket = socket() wait for incoming create socket, TCP connection request connect to hostid , port= x connection setup clientSocket = socket() connectionSocket = serverSocket.accept() send request using clientSocket read request from connectionSocket write reply to connectionSocket read reply from clientSocket close connectionSocket close clientSocket 77

  51. Example app: TCP client Python TCPClient from socket import * serverName = ’servername’ serverPort = 12000 create TCP socket for server, clientSocket = socket(AF_INET, SOCK_STREAM) remote port 12000 clientSocket.connect((serverName,serverPort)) sentence = raw_input(‘Input lowercase sentence:’) clientSocket.send(sentence.encode()) No need to attach server name, modifiedSentence = clientSocket.recv(1024) port print (‘From Server:’, modifiedSentence.decode()) clientSocket.close() 78

  52. Example app: TCP server Python TCPServer from socket import * serverPort = 12000 create TCP welcoming serverSocket = socket(AF_INET,SOCK_STREAM) socket serverSocket.bind((‘’,serverPort)) serverSocket.listen(1) server begins listening for print ‘The server is ready to receive’ incoming TCP requests while True: connectionSocket, addr = serverSocket.accept() loop forever server waits on accept() for incoming requests, new socket sentence = connectionSocket.recv(1024).decode() created on return capitalizedSentence = sentence.upper() connectionSocket.send(capitalizedSentence. read bytes from socket (but not encode()) address as in UDP) connectionSocket.close() close connection to this client (but not welcoming socket) 79

  53. Port Numbers Ø Commonly used: § 21 : File Transfer Protocol (FTP) § 22 : Secure Shell (SSH) § 23 : Telnet remote login service § 25 : Simple Mail Transfer Protocol (SMTP) § 80 : Hypertext Transfer Protocol (HTTP) used in the World Wide Web § 110 : Post Office Protocol (POP3) § 123 : Network Time Protocol (NTP) § 143 : Internet Message Access Protocol (IMAP) § 443 : HTTP Secure (HTTPS) Ø The registered ports are those from 1024 through 49151. IANA maintains the official list of registered ports. Ø The dynamic or private ports are those from 49152 through 65535. 80

  54. Performance Ø Bandwidth § Width of the frequency band § Number of bits per second that can be transmitted over a communication link Ø 1 Mbps: 1 x 10 6 bits/second = 1x2 20 bits/sec Ø 1 x 10 -6 seconds to transmit each bit or imagine that a timeline, now each bit occupies 1 micro second space. Ø On a 2 Mbps link the width is 0.5 micro second. Ø Smaller the width more will be transmission per unit time. 81

  55. Bandwidth Bits transmitted at a particular bandwidth can be regarded as having some width: (a) bits transmitted at 1Mbps (each bit 1 µs wide); (b) bits transmitted at 2Mbps (each bit 0.5 µs wide). 82

  56. How do loss and delay occur? packets queue in router buffers Ø packet arrival rate to link (temporarily) exceeds output link capacity Ø packets queue, wait for turn packet being transmitted (delay) A B packets queueing (delay) free (available) buffers: arriving packets dropped (loss) if no free buffers 83

  57. Four sources of packet delay transmission A propagation B nodal queueing processing d nodal = d proc + d queue + d trans + d prop d queue : queueing delay d proc : nodal processing § time waiting at output link for § check bit errors transmission § determine output link § depends on congestion level of § typically < msec router 84

  58. Four Sources of Packet Delay transmission A propagation B nodal queueing processing d nodal = d proc + d queue + d trans + d prop d prop : propagation delay: d trans : transmission delay: § d : length of physical link § L : packet length (bits) § s : propagation speed in medium (~2x10 8 § R : link bandwidth (bps) m/sec) § d trans = L/R § d prop = d / s d trans and d prop very different 85

  59. Caravan analogy 100 km 100 km ten-car toll toll caravan booth booth Ø time to “push” entire caravan Ø cars “propagate” at through toll booth onto 100 km/hr highway = 12*10 = 120 sec Ø toll booth takes 12 sec to Ø time for last car to propagate service car (bit transmission from 1st to 2nd toll both: time) 100km/(100km/hr)= 1 hr Ø car~bit; caravan ~ packet Ø A: 62 minutes Ø Q: How long until caravan is lined up before 2nd toll booth? 86

  60. Caravan analogy (more) 100 km 100 km ten-car toll toll caravan booth booth Ø suppose cars now “propagate” at 1000 km/hr Ø and suppose toll booth now takes one min to service a car Ø Q: Will cars arrive to 2nd booth before all cars serviced at first booth? Ø A: Yes! after 7 min, 1st car arrives at second booth; three cars still at 1st booth. 87

  61. Queueing delay (revisited) Ø R: link bandwidth (bps) Ø L: packet length (bits) average queueing delay Ø a: average packet arrival rate traffic intensity v La/R ~ 0: avg. queueing delay small = La/R v La/R -> 1: avg. queueing delay large v La/R > 1: more “work” arriving than can be serviced, average delay infinite! La/R -> 1 La/R ~ 0 88

  62. “Real” Internet delays and routes Ø what do “real” Internet delay & loss look like? Ø traceroute program: provides delay measurement from source to router along end-end Internet path towards destination. For all i: § sends three packets that will reach router i on path towards destination § router i will return packets to sender § sender times interval between transmission and reply. 3 probes 3 probes 3 probes 89

  63. Real Internet Delays, routes traceroute to openairinterface.org From UAlbany 3 delay measurements trans-oceanic link * means no response (probe lost, router not replying) From Home 90

  64. Packet loss Ø queue (aka buffer) preceding link in buffer has finite capacity Ø packet arriving to full queue dropped (aka lost) Ø lost packet may be retransmitted by previous node, by source end system, or not at all buffer packet being transmitted (waiting area) A B packet arriving to full buffer is lost 91

  65. Throughput Ø throughput: rate (bits/time unit) at which bits transferred between sender/receiver § instantaneous: rate at given point in time § average: rate over longer period of time server, with link capacity link capacity pipe that can carry pipe that can carry server sends bits file of F bits R s bits/sec R c bits/sec fluid at rate fluid at rate (fluid) into pipe to send to client R s bits/sec) R c bits/sec) 92

  66. Throughput (more) Ø R s < R c What is average end-end throughput? R s bits/sec R c bits/sec v R s > R c What is average end-end throughput? R s bits/sec R c bits/sec bottleneck link link on end-end path that constrains end-end throughput 93

  67. Throughput: Internet scenario Ø per-connection end-end throughput: min(R c ,R s ,R/ R s 10) R s R s Ø in practice: R c or R s is often bottleneck R R c R c R c 10 connections (fairly) share backbone bottleneck link R bits/sec 94

  68. Performance Ø Latency = Propagation + processing + transmit + queue Ø Propagation = distance/speed of light Ø Transmit = size/bandwidth Ø Processing = depends on the node (hardware + software) Ø One bit transmission => propagation is important Ø Large bytes transmission => bandwidth is important 95

  69. Delay X Bandwidth Ø We think the channel between a pair of processes as a hollow pipe Ø Latency (delay) length of the pipe and bandwidth the width of the pipe Ø Delay of 50 ms and bandwidth of 45 Mbps § 50 x 10 -3 seconds x 45 x 10 6 bits/second § 2.25 x 10 6 bits = 280 KB data. Network as a pipe 96

  70. Delay X Bandwidth Ø Relative importance of bandwidth and latency depends on application § For large file transfer, bandwidth is critical § For small messages (HTTP, NFS, etc.), latency is critical § Variance in latency (jitter) can also affect some applications ( e.g. , audio/video conferencing) 97

  71. Delay X Bandwidth Ø 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 98

  72. Delay X Bandwidth Ø Infinite bandwidth § RTT dominates § Throughput = TransferSize / TransferTime § TransferTime = RTT + 1/Bandwidth x TransferSize Ø Its all relative § 1-MB file to 1-Gbps link looks like a 1-KB packet to 1-Mbps link 99

  73. Relationship between bandwidth and latency A 1-MB file would fill the 1-Mbps link 80 times, but only fill the 1-Gbps link 1/12 of one time 100

Recommend


More recommend