computer communication networks foundation
play

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

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


  1. Packet-switching: store-and-forward L bits per packet 3 1 2 source destination R bps R bps takes L / R seconds to transmit (push one-hop numerical example: out) L -bit packet into link at R bps § L = 7.5 Mbits store and forward: entire packet must § R = 1.5 Mbps arrive at router before it can be § one-hop transmission delay = transmitted on next link 5 sec v end-end delay = 2 L / R (assuming zero propagation delay) more on delay shortly … 28

  2. 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 29

  3. 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 30

  4. 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 31

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

  6. 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 * 33

  7. 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)? 34

  8. 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 35

  9. 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 36

  10. 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 37

  11. 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 38

  12. 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 39

  13. 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 40

  14. 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 regional net access net access net access access net net access net 41

  15. 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 regional net access net access net access access net net access net 42

  16. 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 43

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

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

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

  20. 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 47

  21. Network Architecture Example of a layered network system 48

  22. Network Architecture Layered system with alternative abstractions available at a given layer 49

  23. 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 50

  24. 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 51

  25. 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 52

  26. Interfaces Service and Peer Interfaces 53

  27. 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 54

  28. Protocol Graph Message Stream Protocol Request Reply Protocol Host-to-Host Protocol Example of a protocol graph nodes are the protocols and links the “depends-on” relation 55

  29. 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? 56

  30. 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 57

  31. 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 58

  32. 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? 59

  33. OSI Architecture The OSI 7-layer Model OSI –Open Systems Interconnection 60

  34. 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 61

  35. 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 62

  36. Internet Protocol Stack (RFC 1122, 1989) Ø 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” 63

  37. Encapsulation High-level messages are encapsulated inside of low-level messages 64

  38. 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 network H n H t M application M 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 65

  39. 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. 66

  40. 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 67

  41. 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) 68

  42. 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 69

  43. 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 70

  44. 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 Internet link link physical physical 71

  45. Socket programming Two socket types for two transport services: § User Datagram Protocol (UDP): o unreliable datagram § Transmission Control Protocol (TCP): o 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 72

  46. 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 73

  47. 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. 74

  48. Client/server socket interaction: UDP server (running on serverIP ) client 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 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 server (running on hostid ) client create socket, port= x , for incoming request: serverSocket = socket() wait for incoming create socket, TCP connection request connect to hostid , port= x connection setup connectionSocket = clientSocket = socket() serverSocket.accept() send request using read request from clientSocket connectionSocket write reply to connectionSocket read reply from clientSocket close close connectionSocket clientSocket 77

  51. Socket Programming in C Ø http://beej.us/guide/bgnet/ 78

  52. C Program Output UDP Client UDP Server TCP Server TCP Client 79

  53. Socket Programming in Python Ø https://docs.python.org/2/howto/sockets.html 80

  54. 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 clientSocket.sendto (message.encode(), input 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 81

  55. 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 82

  56. 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() 83

  57. 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) 84

  58. 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. 85

  59. 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). 86

  60. 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 87

  61. 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 88

  62. 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 (~3x10 8 § R : link bandwidth (bps) m/sec) § d trans = L/R § d prop = d / s d trans and d prop very different 89

  63. 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? 90

  64. 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. 91

  65. 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 92

  66. “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 93

  67. 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 94

  68. 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 A (waiting area) B packet arriving to full buffer is lost 95

  69. 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 link capacity server, with 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) 96

  70. 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 97

  71. Throughput: Internet scenario Ø per-connection end-end throughput: R s min(R c ,R s ,R/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 Rbits/sec 98

  72. Performance Ø Latency = Propagation + processing + transmit + queue Ø Propagation = distance/speed of light Ø Transmit = size/bandwidth Ø Processing = depends on the node (hardware + software) Ø RTT => Round Trip Time B A Internet Ø One bit transmission => propagation is important Ø Large bytes transmission => bandwidth is important 99

  73. 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 100

Recommend


More recommend