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 that different applications and different communities place on the computer network

Ø 

Introducing the idea of network architecture

Ø 

Introducing some key elements in implementing Network Software

Ø 

Define key metrics that will be used to evaluate the performance of computer network

3

Applications Ø 

§  §  §  §  §  §  § 

Most people know about the Internet (a computer network) through applications World Wide Web Email Online Social Network Streaming Audio Video File Sharing Instant Messaging …

4

Example of an application

A multimedia application including video-conferencing 5

Application Protocol Ø 

URL

§  Uniform Resource Locater §  http://www.albany.edu/faculty/dsaha/

Ø 

HTTP

§  Hyper Text Transfer Protocol

Ø 

TCP

§  Transmission Control Protocol

Ø 

17 messages for one URL request

§  6 to find the IP (Internet Protocol) address §  3 for connection establishment of TCP §  4 for HTTP request and acknowledgement o  Request: I got your request and I will send the data o  Reply: Here is the data you requested; I got the data §  4 messages for tearing down TCP connection 6

Requirements Ø 

Application Programmer

§  List the services that his application needs: delay bounded delivery of data Ø 

Network Designer

§  Design a cost-effective network with sharable resources Ø 

Network Provider

§  List the characteristics of a system that is easy to manage

7

What’s the Internet: “nuts and bolts” view Ø 

PC server wireless laptop

§ 

Packet switches: forward packets (chunks of data)

mobile network global ISP

routers and switches

smartphone

Ø  wireless links wired links

§  § 

Ø  router

§  § 

Millions of connected computing devices:

home network

regional ISP

hosts = end systems running network apps

Communication links Fiber, copper, radio, satellite Transmission rate: bandwidth

institutional network 8

What’s the Internet: “nuts and bolts” view Ø  § 

Internet: “network of networks” Interconnected ISPs

mobile network global ISP

Ø  § 

Ø  §  § 

protocols control sending, receiving of msgs

home network

e.g., TCP, IP, HTTP, Skype, 802.11

regional ISP

Internet standards RFC: Request for comments IETF: Internet Engineering Task Force institutional network 9

What’s the Internet: “service” view Ø 

Infrastructure that provides services to applications:

mobile network global ISP

§  Web, VoIP, email, games, e-commerce, social nets, … Ø 

provides programming interface to apps

home network

regional ISP

§  hooks that allow sending and receiving app programs to “connect” to Internet §  provides service options, analogous to postal service institutional network 10

Connectivity Ø 

Need to understand the following terminologies

Scale Link Nodes Point-to-point Multiple access Switched Network o  Circuit Switched o  Packet Switched §  Packet, message §  Store-and-forward §  §  §  §  §  § 

(a)  (b) 

Point-to-point Multiple access

11

Connectivity Ø  §  §  §  §  §  §  §  §  § 

(a)

(b)

(a)  (b) 

Terminologies (contd.) Cloud Hosts Switches Internetwork Router/gateway Host-to-host connectivity Address Routing Unicast/broadcast/multicast

A switched network Interconnection of networks 12

A closer look at network structure: network edge:

Ø  §  § 

v 

v 

mobile network

hosts: clients and servers servers often in data centers

access networks, physical media: wired, wireless communication links

global ISP

home network

regional ISP

network core:

§ interconnected

routers § network of networks

institutional network 13

Access networks and physical media Q: How to connect end systems to edge router? Ø  Ø  Ø 

residential access nets institutional access networks (school, company) mobile access networks

keep in mind: Ø  Ø 

bandwidth (bits per second) of access network? shared or dedicated?

14

Access net: digital subscriber line (DSL) central office

DSL modem

splitter

voice, data transmitted at different frequencies over dedicated line to central office

Ø 

telephone network

DSLAM

ISP DSL access multiplexer

use existing telephone line to central office DSLAM

§  data over DSL phone line goes to Internet §  voice over DSL phone line goes to telephone net

Ø  Ø 

< 2.5 Mbps upstream transmission rate (typically < 1 Mbps) < 24 Mbps downstream transmission rate (typically < 10 Mbps) 15

Access net: cable network cable headend

… cable modem

splitter

V I D E O

V I D E O

V I D E O

V I D E O

V I D E O

V I D E O

D A T A

D A T A

C O N T R O L

1

2

3

4

5

6

7

8

9

Channels

frequency division multiplexing: different channels transmitted in different frequency bands 16

Access net: cable network cable headend

… cable modem

splitter

data, TV transmitted at different frequencies over shared cable distribution network

v 

v 

cable modem termination system

CMTS

ISP

HFC: hybrid fiber coax §  asymmetric: up to 30Mbps downstream transmission rate, 2 Mbps upstream transmission rate network of cable, fiber attaches homes to ISP router §  homes share access network to cable headend §  unlike DSL, which has dedicated access to central office 17

Access net: home network wireless devices

to/from headend or central office often combined in single box

cable or DSL modem wireless access point (54 Mbps)

router, firewall, NAT wired Ethernet (100 Mbps)

18

Enterprise access networks (Ethernet)

institutional link to ISP (Internet) institutional router Ethernet switch

Ø  Ø  Ø 

institutional mail, web servers

typically used in companies, universities, etc 10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates today, end systems typically connect into Ethernet switch 19

Wireless access networks Ø 

shared wireless access network connects end system to router

§  via base station aka “access point”

wireless LANs:

§  within building (100 ft) §  802.11b/g (WiFi): 11, 54 Mbps transmission rate

to Internet

wide-area wireless access §  provided by AT&T (cellular) operator, 10’s km §  between 1 and 10 Mbps §  3G, 4G: LTE

to Internet 20

Host: sends packets of data host sending function: v  takes application message v  breaks into smaller chunks, known as packets, of length L bits v  transmits packet into access network at transmission rate R §  link transmission rate, aka link capacity, aka link bandwidth packet transmission delay

=

two packets, L bits each

2 1

R: link transmission rate

host

time needed to transmit L-bit packet into link

=

L (bits) R (bits/sec) 21

Physical media bit: propagates between transmitter/receiver pairs Ø  physical link: what lies between transmitter & receiver Ø  guided media: §  signals propagate in solid media: copper, fiber, coax Ø  unguided media: §  signals propagate freely, e.g., radio Ø 

twisted pair (TP) two insulated copper wires Category 5: 100 Mbps, 1 Gpbs Ethernet Category 6: 10Gbps

22

Physical media: coax, fiber coaxial cable: Ø  Ø  Ø 

two concentric copper conductors bidirectional broadband:

§  multiple channels on cable §  HFC

fiber optic cable: Ø  Ø 

glass fiber carrying light pulses, each pulse a bit high-speed operation:

§  high-speed point-to-point transmission (e.g., 10’s-100’s Gpbs transmission rate) Ø 

low error rate:

§  repeaters spaced far apart §  immune to electromagnetic noise

23

Physical media: radio signal carried in electromagnetic spectrum Ø  no physical “wire” Ø  bidirectional Ø  propagation environment effects: §  reflection §  obstruction by objects §  interference Ø 

radio link types: Ø 

§  Ø 

§  Ø 

§  Ø 

§  §  § 

terrestrial microwave e.g. up to 45 Mbps channels LAN (e.g., WiFi) 11Mbps, 54 Mbps wide-area (e.g., cellular) 3G cellular: ~ few Mbps satellite Kbps to 45Mbps channel (or multiple smaller channels) 270 msec end-end delay geosynchronous versus low altitude

24

Cost-Effective Resource Sharing Ø 

Multiplexing multiple logical flows over a single physical link

Resource: links and nodes How to share a link?

Ø  §  Multiplexing §  De-multiplexing §  Synchronous Time-division Multiplexing §  Time slots/data transmitted in predetermined slots

25

Cost-Effective Resource Sharing Ø 

FDM: Frequency Division Multiplexing

§  Statistical Multiplexing §  Data is transmitted based on demand of each flow. Ø  What is a flow? §  Packets vs. Messages §  FIFO, Round-Robin, Priorities (Quality-of-Service (QoS)) A switch multiplexing packets from multiple sources onto one shared link §  Congested? §  LAN, MAN, WAN §  SAN (System Area Networks) 26

Packet-switching: store-and-forward L bits per packet source

3 2 1

R bps

takes L/R seconds to transmit (push out) L-bit packet into link at R bps store and forward: entire packet must arrive at router before it can be transmitted on next link v 

R bps

destination

one-hop numerical example: § L = 7.5 Mbits § R = 1.5 Mbps § one-hop transmission delay = 5 sec

end-end delay = 2L/R (assuming zero more on delay shortly … propagation delay) 27

Packet Switching: queueing delay, loss C

R = 100 Mb/s

A B

R = 1.5 Mb/s

D

queue of packets waiting for output link

E

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

Two key network-core functions routing: determines source-

destination route taken by packets §  routing algorithms

forwarding: move packets from

router’s input to appropriate router output

routing algorithm

local forwarding table header value output link 0100 0101 0111 1001

3 2 2 1

1 3 2

dest address in arriving packet’s header

Network Layer

29

Alternative core: circuit switching end-end resources allocated to, reserved for “call” between source & dest: Ø  §  Ø  §  Ø 

Ø 

In diagram, each link has four circuits. call gets 2nd circuit in top link and 1st 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

Circuit switching: FDM versus TDM Example:

FDM

4 users frequency time

TDM

frequency time 31

Packet switching versus circuit switching packet switching allows more users to use network!

•  100 kb/s when “active” •  active 10% of time

N users

…..

example: §  1 Mb/s link §  each user:

1 Mbps link

circuit-switching: 10 users

packet switching: with 35 users, probability > 10 active at same time is less than .0004 *

Q: how did we get value 0.0004? Q: what happens if > 35 users ?

32

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 ondemand allocation (packet-switching)? 33

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

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



access net

access net

… access net

access net

access net



access net

access net

access net

access net

access net access net

access net

access net



access net

access net

35



Internet structure: network of networks Option: connect each access ISP to every other access ISP?



access net access net access net

access net

access net

… access net



access net



connecting each access ISP to each other directly doesn’t scale: O(N2) connections.



access net

access net

access net

access net access net

access net

access net



access net

access net

36



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



access net

access net

… access net

access net

access net



access net

global ISP

access net

access net

access net

access net access net

access net

access net



access net

access net

37



Internet structure: network of networks But if one global ISP is viable business, there will be competitors ….

access net



access net

access net

… access net

access net access net

access net



ISP A

access net

ISP B ISP C

access net access net access net

access net

access net





access net

access net

access net

38

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 access net





net

net

access net

access net

IXP

access net

access net



ISP A IXP

access net

ISP B

ISP C access net

peering link

access net access net

access net

access net





access net

access net

access net

39

Internet structure: network of networks … and regional networks may arise to connect access nets to ISPS access net





access net

access net

access net

access net

IXP

access net

access net



ISP A IXP

access net

ISP B

ISP C access net

regional net

access net access net

access net

access net





access net

access net

access net

40

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 net



access net

access net

… access net

access net

IXP

access net

access net

ISP A



Content provider network IXP

access net

ISP B

ISP B access net

regional net

access net access net

access net

access net





access net

access net

access net

41

Internet structure: network of networks Tier 1 ISP

Tier 1 ISP

IXP

IXP Regional ISP

access ISP Ø 

access ISP

Google

access ISP

IXP

Regional ISP

access ISP

access ISP

access ISP

access ISP

access 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

Tier-1 ISP: e.g., Sprint POP: point-of-presence

to/from backbone peering











to/from customers

43

Support for Common Services Ø 

Logical Channels

§  Application-to-Application communication path or a pipe

Process communicating over an abstract channel 44

Common Communication Patterns Ø 

Client/Server Two types of communication channel

Ø  §  Request/Reply Channels §  Message Stream Channels

45

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

Network Architecture

Example of a layered network system

47

Network Architecture

Layered system with alternative abstractions available at a given layer 48

What is a protocol? Ø  §  §  §  § 

Human Protocols: What’s the time? I have a question…. Hi, I am XYZ…. Hello, how are you?

Ø  Network Protocols: §  Nodes / machines in the network participate §  Communication activity in Internet is governed by 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

What is a protocol? Ø 

Human Protocols:

Ø 

Hi

Network Protocols:

TCP connection request

Hi

TCP connection response Get http://www.albany.edu/faculty/dsaha/

Got the time?

2:00

time

50

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

Interfaces

Service and Peer Interfaces 52

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

Protocol Graph

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

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

Organization of air travel ticket (purchase)

ticket (complain)

baggage (check)

baggage (claim)

gates (load)

gates (unload)

runway takeoff

runway landing

airplane routing

airplane routing

airplane routing

56

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 departure airport

airplane routing

airplane routing

intermediate air-traffic control centers

arrival airport

Ø  layers: each layer implements a service §  via its own internal-layer actions §  relying on services provided by layer below 57

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

OSI Architecture The OSI 7-layer Model OSI – Open Systems Interconnection

59

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

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

Internet Protocol Stack Ø  application: supporting network applications §  FTP, SMTP, HTTP Ø  transport: process-process data transfer §  TCP, UDP Ø 

network: routing of datagrams from source to destination

§  IP, routing protocols Ø 

link: data transfer between neighboring network elements

application transport network link physical

§  Ethernet, 802.11 (WiFi) Ø 

physical: bits “on the wire” / “over the air” 62

Encapsulation

High-level messages are encapsulated inside of low-level messages 63

Encapsulation message segment datagram frame

M Ht

M

Hn Ht

M

Hl Hn Ht

M

application transport network link physical

source

link physical switch

destination M Ht

M

Hn Ht

M

Hl Hn Ht

M

application transport network link physical

Hn Ht

M

Hl Hn Ht

M

network link physical

Hn Ht

M

router 64

Internet Architecture

Internet Protocol Graph

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

65

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

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

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

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

Sockets Ø  Ø 

process sends/receives messages to/from its socket socket analogous to door between application process & endend-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

process

socket

application

process

transport

transport

network

network

link physical

Internet

link

controlled by app developer controlled by OS

physical

70

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

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

Client/server socket interaction: UDP server (running on serverIP) create socket, port= x: serverSocket = socket(AF_INET,SOCK_DGRAM)

read datagram from serverSocket write reply to serverSocket specifying client address, port number

client create socket: clientSocket = socket(AF_INET,SOCK_DGRAM) Create datagram with server IP and port=x; send datagram via clientSocket

read datagram from clientSocket close clientSocket 73

Example app: UDP client Python UDPClient include Python’s socket library

create UDP socket for server get user keyboard input Attach server name, port to message; send into socket read reply characters from socket into string print out received string and close socket

from socket import * serverName = ‘hostname’ serverPort = 12000 clientSocket = socket(AF_INET, SOCK_DGRAM) message = raw_input(’Input lowercase sentence:’) clientSocket.sendto(message.encode(), (serverName, serverPort))

modifiedMessage, serverAddress = clientSocket.recvfrom(2048) print modifiedMessage.decode() clientSocket.close()

74

Example app: UDP server Python UDPServer

create UDP socket bind socket to local port number 12000

loop forever Read from UDP socket into message, getting client’s address (client IP and port) send upper case string back to this client

from socket import * serverPort = 12000 serverSocket = socket(AF_INET, SOCK_DGRAM) serverSocket.bind(('', serverPort)) print (“The server is ready to receive”) while True: message, clientAddress = serverSocket.recvfrom(2048) modifiedMessage = message.decode().upper() serverSocket.sendto(modifiedMessage.encode(), clientAddress)

75

Socket programming with TCP client must contact server Ø  Ø 

server process must first be running server must have created socket (door) that welcomes client’s contact

client contacts server by: Ø 

Ø 

Creating TCP socket, specifying IP address, port number of server process when client creates socket: client TCP establishes connection to server TCP

when contacted by client, server TCP creates new socket for server process to communicate with that particular client §  allows server to talk with multiple clients §  source port numbers used to distinguish clients (more in Chap 3)

Ø 

application viewpoint: TCP provides reliable, in-order byte-stream transfer (“pipe”) between client and server 76

Client/server socket interaction: TCP server (running on hostid)

client

create socket, port=x, for incoming request: serverSocket = socket() wait for incoming connection request connectionSocket = serverSocket.accept() read request from connectionSocket write reply to connectionSocket close connectionSocket

TCP connection setup

create socket, connect to hostid, port=x clientSocket = socket() send request using clientSocket

read reply from clientSocket close clientSocket 77

Example app: TCP client Python TCPClient

create TCP socket for server, remote port 12000

No need to attach server name, port

from socket import * serverName = ’servername’ serverPort = 12000 clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket.connect((serverName,serverPort)) sentence = raw_input(‘Input lowercase sentence:’) clientSocket.send(sentence.encode()) modifiedSentence = clientSocket.recv(1024) print (‘From Server:’, modifiedSentence.decode()) clientSocket.close()

78

Example app: TCP server Python TCPServer create TCP welcoming socket

server begins listening for incoming TCP requests loop forever server waits on accept() for incoming requests, new socket created on return read bytes from socket (but not address as in UDP) close connection to this client (but not welcoming socket)

from socket import * serverPort = 12000 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind((‘’,serverPort)) serverSocket.listen(1) print ‘The server is ready to receive’ while True: connectionSocket, addr = serverSocket.accept() sentence = connectionSocket.recv(1024).decode() capitalizedSentence = sentence.upper() connectionSocket.send(capitalizedSentence. encode()) connectionSocket.close()

79

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

Performance Ø 

Bandwidth

§  Width of the frequency band §  Number of bits per second that can be transmitted over a communication link Ø  Ø  Ø  Ø 

1 Mbps: 1 x 106 bits/second = 1x220 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

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

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

Four sources of packet delay transmission

A

propagation

B

nodal processing

queueing

dnodal = dproc + dqueue + dtrans + dprop

dproc: nodal processing §  check bit errors §  determine output link §  typically < msec

dqueue: queueing delay

§  time waiting at output link for transmission §  depends on congestion level of router 84

Four Sources of Packet Delay transmission

A

propagation

B

nodal processing

queueing

dnodal = dproc + dqueue + dtrans + dprop dtrans: transmission delay:

§  L: packet length (bits) §  R: link bandwidth (bps) §  dtrans = L/R dtrans and dprop very different

dprop: propagation delay:

§  d: length of physical link §  s: propagation speed in medium (~2x108 m/sec) §  dprop = d/s 85

Caravan analogy 100 km ten-car caravan Ø  Ø 

Ø  Ø 

toll booth

cars “propagate” at 100 km/hr toll booth takes 12 sec to service car (bit transmission time) car~bit; caravan ~ packet Q: How long until caravan is lined up before 2nd toll booth?

100 km toll booth

Ø 

Ø 

Ø 

time to “push” entire caravan through toll booth onto highway = 12*10 = 120 sec time for last car to propagate from 1st to 2nd toll both: 100km/(100km/hr)= 1 hr A: 62 minutes

86

Caravan analogy (more) 100 km ten-car caravan Ø  Ø  Ø 

toll booth

100 km toll 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

Ø  Ø  Ø 

R: link bandwidth (bps) L: packet length (bits) a: average packet arrival rate

average queueing delay

Queueing delay (revisited)

La/R ~ 0: avg. queueing delay small v  La/R -> 1: avg. queueing delay large v  La/R > 1: more “work” arriving than can be serviced, average delay infinite! v 

traffic intensity = La/R

La/R ~ 0

La/R -> 1 88

“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

Real Internet Delays, routes From UAlbany traceroute to openairinterface.org

3 delay measurements

trans-oceanic link * means no response (probe lost, router not replying)

From Home 90

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 (waiting area)

A

packet being transmitted

B packet arriving to full buffer is lost 91

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,sends with bits server file ofinto F bits (fluid) pipe to send to client

link capacity pipe that can carry Rs bits/sec fluid at rate Rs bits/sec)

link capacity pipe that can carry Rc bits/sec fluid at rate Rc bits/sec) 92

Throughput (more) Ø 

Rs < Rc What is average end-end throughput? Rs bits/sec

v  Rs > Rc

Rc bits/sec

What is average end-end throughput? Rs bits/sec

Rc bits/sec

bottleneck link link on end-end path that constrains end-end throughput 93

Throughput: Internet scenario Ø 

Ø 

per-connection end-end throughput: min(Rc,Rs,R/ 10) in practice: Rc or Rs is often bottleneck

Rs Rs

Rs R

Rc

Rc Rc

10 connections (fairly) share backbone bottleneck link R bits/sec 94

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

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 106 bits/second §  2.25 x 106 bits = 280 KB data.

Network as a pipe 96

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

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

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

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

Internet History 1961-1972: Early packet-switching principles Ø 

Ø  Ø 

Ø 

1961: Kleinrock - queueing theory shows effectiveness of packet-switching 1964: Baran - packet-switching in military nets 1967: ARPAnet conceived by Advanced Research Projects Agency 1969: first ARPAnet node operational

Ø 

§  §  §  § 

1972: ARPAnet public demo NCP (Network Control Protocol) first host-host protocol first e-mail program ARPAnet has 15 nodes

Introduction

101

Internet History 1972-1980: Internetworking, new and proprietary nets Ø  Ø 

Ø  Ø  Ø  Ø 

1970: ALOHAnet satellite network in Hawaii 1974: Cerf and Kahn architecture for interconnecting networks 1976: Ethernet at Xerox PARC late70’s: proprietary architectures: DECnet, SNA, XNA late 70’s: switching fixed length packets (ATM precursor) 1979: ARPAnet has 200 nodes

Cerf and Kahn’s internetworking principles: minimalism, autonomy - no internal changes required to interconnect networks best effort service model stateless routers decentralized control

define today’s Internet architecture

Introduction

102

Internet History 1980-1990: new protocols, a proliferation of networks Ø  Ø  Ø 

Ø  Ø 

1983: deployment of TCP/ IP 1982: smtp e-mail protocol defined 1983: DNS defined for name-to-IP-address translation 1985: ftp protocol defined 1988: TCP congestion control

Ø  Ø 

new national networks: Csnet, BITnet, NSFnet, Minitel 100,000 hosts connected to confederation of networks

103

Internet History 1990, 2000’s: commercialization, the Web, new apps Ø  early 1990’s: ARPAnet

decommissioned Ø  1991: NSF lifts restrictions on commercial use of NSFnet (decommissioned, 1995) Ø  early 1990s: Web §  hypertext [Bush 1945, Nelson 1960’s] §  HTML, HTTP: Berners-Lee §  1994: Mosaic, later Netscape §  late 1990’s: commercialization of the Web

late 1990’s – 2000’s: Ø  more killer apps: instant messaging, P2P file sharing Ø  network security to forefront Ø  est. 50 million host, 100 million+ users Ø  backbone links running at Gbps

Introduction

104

Internet History 2005-present Ø  § 

Ø  Ø  Ø 

~750 million hosts Smartphones and tablets

Aggressive deployment of broadband access Increasing ubiquity of high-speed wireless access Emergence of online social networks:

§  Facebook: 1.71 billion active users

Service providers (Google, Microsoft) create their own networks §  Bypass Internet, providing “instantaneous” access to search, email, etc. Ø  E-commerce, universities, enterprises running their services in “cloud” (eg, Amazon EC2) Ø 

105

Summary Ø 

We have identified what we expect from a computer network

Ø 

We have defined a layered architecture for computer network that will serve as a blueprint for our design

Ø 

We have discussed the socket interface which will be used by applications for invoking the services of the network subsystem

Ø 

We have discussed two performance metrics using which we can analyze the performance of computer networks

106

Chapter 1, Problem 4 Ø 

Calculate the total time required to transfer a 1.5MB file in following cases with assumptions a) RTT is 80ms, b) packet size is 1KB, c) initial 2xRTT is required for handshaking before transmission:

§  Bandwidth is 10Mbps and data packets can be sent continuously §  Convert everything in same unit o  1.5MB = 1.5x1024KB = 1.5x1024x1024x8 bits = 12582912bits 10Mbps = 10000000bps §  Total Time = initial 2RTT + Transmit Delay + Propagation Delay (RTT/2) o  80x2/1000 + 12582912/10000000 + 40/1000 secs o  1.458 secs o 

107

Chapter 1, Problem 4 Ø 

Calculate the total time required to transfer a 1.5MB file in following cases with assumptions a) RTT is 80ms, b) packet size is 1KB, c) initial 2xRTT is required for handshaking before transmission:

§  Bandwidth is 10Mbps, but wait for one RTT between packets §  Number of packets o  1.5MB / 1KB = 1.5x1024 = 1536 §  1535 interpacket gaps between 1536 packets §  Add 1535xRTT to previous solution o  1535x80/1000secs + 1.458secs o  124.258 secs 108

Chapter 1, Problem 4 Ø 

Calculate the total time required to transfer a 1.5MB file in following cases with assumptions a) RTT is 80ms, b) packet size is 1KB, c) initial 2xRTT is required for handshaking before transmission:

§  Link allows infinitely fast transmit, but limits bandwidth – 20 packets can be sent in one RTT §  §  §  §  §  § 

Transmit Time = 0 1536 packets / 20 = 76.8 batches (76 full batch and 1 partial batch) Propagation delay for the first batch = RTT/2 Initial Setup = RTTx2 76 batches in 76xRTT time Total = 80x2/1000 + 40/1000 + 76x80/1000 secs = 6.28 secs 109

Chapter 1, Problem 4 Ø 

Calculate the total time required to transfer a 1.5MB file in following cases with assumptions a) RTT is 80ms, b) packet size is 1KB, c) initial 2xRTT is required for handshaking before transmission:

§  Zero transmit time, but limits 1 packet in first RTT, 2 in second, 23-1 in third RTT and so on. §  1 + 2 + 23-1 + ….. + 2n = 2n+1 - 1. o  At n=9, total packets = 1023 o  At n=10, total packets = 2047 o  Thus, we can send all in 11 batches §  Propagation delay for the first batch = RTT/2, Initial Setup = RTTx2 §  10 batches in 10xRTT time §  Total = 80x2/1000 + 40/1000 + 10x80/1000 secs = 1sec 110