0% found this document useful (0 votes)
107 views96 pages

# cs425 - Slides

This document provides an outline and overview of lecture slides for a Computer Networks course. The slides cover topics including: - The OSI reference model and its seven layers. - Internet protocols like TCP/IP and how they compare to the OSI model. - Packet switching technologies including circuit switching, virtual circuit switching, datagram switching, and asynchronous transfer mode (ATM). - Internetworking concepts that allow communication across different networks.

Uploaded by

Abhishek Anand
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views96 pages

# cs425 - Slides

This document provides an outline and overview of lecture slides for a Computer Networks course. The slides cover topics including: - The OSI reference model and its seven layers. - Internet protocols like TCP/IP and how they compare to the OSI model. - Packet switching technologies including circuit switching, virtual circuit switching, datagram switching, and asynchronous transfer mode (ATM). - Internetworking concepts that allow communication across different networks.

Uploaded by

Abhishek Anand
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

Computer Networks CS425

Dr. Ramana
I.I.T Rajasthan

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

1 / 96

Outline of the Lectures


1

2 3

Introduction OSI Reference Model Internet Protocol Packet Switching Technologies Internetworking Introduction The Internet Other Important Protocols Routing on Internet Intradomian Routing Transport Layer User Datagram Protocol Transmission Control Protocol Flow Control in TCP TCP Operations Congestion Control Mechanism Application Layer Protocols
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 2 / 96

Introduction

Key elements of a Network

Standalone Mainframe

Router Wide Area Network (e.g. ATM)

Local Area Network

Router Router

Ethernet switch

Wide Area Network (e.g. ATM)

Local Area Network Ethernet switch

Router
LAN PCs and workstations

Information server

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

3 / 96

Introduction

Layered Architecture

Layer 7 (Application)


Total Communication Function Layer N Decompose (modularity, information-hiding) Service to Layer N+1

Layer N entity

Protocol with peer Layer N


Layer 1 (Physical) Service from Layer N1

OSI-wide standards (e.g., network management, security)

Figure 2.8 The OSI Architecture as a Framework for Standardization


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 4 / 96

Introduction

OSI Reference Model

OSI Reference Model


Application
Provides access to the OSI environment for users and also provides distributed information services.

Principles of layering: Each layer should perform a well-dened function The layer boundary should be chosen to minimize the information ow across the interfaces

Presentation
Provides independence to the application processes from differences in data representation (syntax).

Session
Provides the control structure for communication between applications; establishes, manages, and terminates connections (sessions) between cooperating applications.

Transport
Provides reliable, transparent transfer of data between end points; provides end-to-end error recovery and flow control.

Provides upper layers with independence from the data transmission and switching technologies used to connect systems; responsible for establishing, maintaining, and terminating connections.

Network

Data Link

Provides for the reliable transfer of information across the physical link; sends blocks (frames) with the necessary synchronization, error control, and flow control. Concerned with transmission of unstructured bit stream over physical medium; deals with the mechanical, electrical, functional, and procedural characteristics to access the physical medium.

Physical

The OSI Layers

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

5 / 96

Introduction

OSI Reference Model

(Cont.)
Physical Layer
Physical characteristics of interfaces and media Representation of bits Data rate - number of bits per second Synchronization between sender and receiver Line conguration - point-to-point or multi-point Physical topology - bus/star/ring/mesh Transmission mode - simplex/half duplex/duplex

Data Link Layer


Framing Physical addressing - local address Flow control Error control Access control

Network Layer
Logical addressing - global address Forwarding Routing
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 6 / 96

Introduction

OSI Reference Model

(Cont.)
Transport Layer
Service-point addressing Segmentation and reassembly Connection control Flow control Error control

Session Layer
Dialog Control Synchronization

Presentation Layer
Translation Encryption Compression

Application Layer
Enabling users to access the network services/resource
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 7 / 96

Introduction

OSI Reference Model

(Cont.)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

8 / 96

ISO OSI Protocol Stack


Visit http://en.wikipedia.org/wiki/OSI_model for more details on the OSI Reference Architecture

Introduction

OSI Reference Model

(Cont.)

7: Application 6: Presentation 5: Session 4: Transport 3: Network 2: Link 1: Physical

Application services (SIP, FTP, HTTP, Telnet, ) Data translation (MIME) Encryption (SSL) Compression

Dialog control Synchronization

Reliable (TCP) Real-time (RTP)

Source-to-destination (IP) Routing Address resolution

MAC

Wireless link (WiFi) Wired link (Ethernet) Radio spectrum Infrared Fiber Copper

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

9 / 96

Introduction

Internet Protocol

TCP/IP Protocol Stack

OSI Application Presentation Session Transport Network Data Link Physical

TCP/IP

Application

Transport (host-to-host) Internet Network Access Physical

A Comparison of the OSI and TCP/IP Protocol Architectures


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 10 / 96

Introduction

Internet Protocol

(Cont.)
MIME

BGP

FTP

HTTP

SMTP

TELNET

SNMP

TCP

UDP

ICMP

IGMP

OSPF

RSVP

IP
BGP FTP HTTP ICMP IGMP IP MIME = = = = = = = Border Gateway Protocol File Transfer Protocol Hypertext Transfer Protocol Internet Control Message Protocol Internet Group Management Protocol Internet Protocol Multipurpose Internet Mail Extension OSPF RSVP SMTP SNMP TCP UDP = = = = = = Open Shortest Path First Resource ReSerVation Protocol Simple Mail Transfer Protocol Simple Network Management Protocol Transmission Control Protocol User Datagram Protocol

Some Protocols in the TCP/IP Protocol Suite


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 11 / 96

Introduction

Internet Protocol

(Cont.)

User data

Application byte stream

TCP header

TCP segment

IP header

IP datagram

Network header

Network-level packet

Protocol Data Units (PDUs) in the TCP/IP Architecture

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

12 / 96

Packet Switching Technologies

Switching Technologies
(a) Circuit switching Call request signal propagation delay processing delay Call request packet (b) Virtual circuit packet switching (c) Datagram packet switching

Pkt1
Call accept signal Call accept packet

Pkt2 Pkt3

Pkt1 Pkt2 Pkt3 Pkt1 Pkt2 Pkt3

User data
Acknowledgement signal

Pkt1 Pkt2 Pkt3 Pkt1 Pkt2 Pkt3 Pkt1 Pkt2 Pkt3


Acknowledgement packet

link Nodes: 1 2

link 3

link 4 1 2 3 4 1 2 3 4

Figure 10.12 Event Timing for Circuit Switching and Packet Switching
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 13 / 96

Packet Switching Technologies

Virtual Circuit (VC) Switching


Mainframe

Personal computer

C
Server

Personal computer

Personal computer

Packet-Switching Network

E
Personal computer

A
Solid line = physical link Dashed line = virtual circuit

Figure 10.13 The Use of Virtual Circuits

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

14 / 96

Packet Switching Technologies

(Cont.)
3 2 1

(a)
3

(b)

(c)

2 1

(d)

(e)

Figure 10.10 Packet Switching: Virtual-Circuit Approach

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

15 / 96

Packet Switching Technologies

Packet Switching
3 2 1

(a)
3

(b) 3
2

(c)
3

2 1

(d)

(e)

Figure 10.9 Packet Switching: Datagram Approach

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

16 / 96

Packet Switching Technologies

VC Setup

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

17 / 96

Packet Switching Technologies

Packets on VC

AT Switch 1 InInterface 2 AT Switch 2 InInterface 3


Dr. Ramana ( I.I.T Rajasthan )

InVCI 5 InVCI 11

OutInterface 1 OutInterface 2

OutVCI 11 OutVCI 7
18 / 96

Computer Networks CS425

Packet Switching Technologies

(Cont.)

AT Switch 2 InInterface 3 AT Switch 3 InInterface 0


Dr. Ramana ( I.I.T Rajasthan )

InVCI 11 InVCI 7

OutInterface 2 OutInterface 1

OutVCI 7 OutVCI 4
19 / 96

Computer Networks CS425

Packet Switching Technologies

Large vs Short Packet Sizes


(a) 1-packet message (b) 2-packet message (c) 5-packet message (d) 10-packet message Header Data Data 1

1 2 3
Data Data 2 1

1 2 1 2 3 4 5 1 2 3 4 5 3 4 5 1 2 3 4 5 6 7 8 9 10
Y X a b

1 2 3 4 5 6 7 8 9 10
Y

4 5

6 7 8 9 10

Data

Data Data 2 1

Data 2

X Data

Figure 10.11 Effect of Packet Size on Transmission Time Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425

20 / 96

Packet Switching Technologies

Asynchronous Transfer Mode

Cell size is xed and short, 53 Bytes = 5B Header + 48B Data Offered services, Constant Bit Rate, Variable Bit Rate, Available Bit Rate, Unspecied Bit Rate via, different ATM Adaption Layers, AAL1-CBR, AAL2-VBR, AAL3/4 and AAL5 Data
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 21 / 96

Packet Switching Technologies

Virtual paths and channels

Virtual Channels

Virtual Path

Physical Transmission Path

Figure 11.2 ATM Connection Relationships

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

22 / 96

Packet Switching Technologies

Segmentation and Re-assembly


Depends on the type of AAL Example in AAL 3/4: CS-PDU = Header + User Data + Trailer then CS-PDU is divided into chunks of 44 bytes each chunk is prepended with a AAL 3/4 header, which goes into payload part of ATM cell ATM Cell = ATM Header + AAL3/4 PDU

Convergence sublayer PDU


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 23 / 96

Packet Switching Technologies

Headers
CS-PDU in AAL 3/4

AAL 3/4 Header

ATM Header

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

24 / 96

Packet Switching Technologies

(Cont.)
CS-PDU in AAL5

Segmentation in AAL5

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

25 / 96

Packet Switching Technologies

Services

100%

Available Bit Rate and Unspecified Bit Rate

Percentage of line capacity

Variable Bit Rate Constant Bit Rate

0 Time

Dr. Ramana ( I.I.T Rajasthan )

Figure 11.12 ATM Bit Rate Services Computer Networks CS425

26 / 96

Internetworking

Introduction

Internetworking
Communication among the users from different networks which are based on different networking technologies Challenges:
Resource heterogeneity while offering fairly predictable services Scalability Addressing and Routing

A simple internetwork
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 27 / 96

Internetworking

Introduction

(Cont.)

Protocol layers used in Internetworking

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

28 / 96

Internetworking

Introduction

Internet

Standalone Mainframe

Router Wide Area Network (e.g. ATM)

Local Area Network

Router Router

Ethernet switch

Wide Area Network (e.g. ATM)

Local Area Network Ethernet switch

Router
LAN PCs and workstations

Information server

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

29 / 96

Internetworking

Introduction

(Cont.)
Subscriber connection

Residential user

Internet service provider (ISP)

High-speed link (e. g. SONET)

Router

Internet

ATM switch

Firewall host

High-speed link

Router

Ethernet switch

ATM Network

Private WAN

Information server

LAN PCs and workstations

Figure 1.6 A Networking Configuration

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

30 / 96

Internetworking

Introduction

(Cont.)
LAN 1 LAN 2

End system (A)


TCP IP LLC MAC Physical

Router (X)

Frame relay WAN

Router (Y)

End system (B)


TCP

t1 t2 t3

t6 t5 t4

IP LLC MAC LAPF

t7 t8

t10
LAPF

IP LLC MAC

t11 t12 t13

t16 t15 t14

IP LLC MAC Physical

Physical Physical

t9

Physical Physical

t1, t6, t7, t10, t11, t16 t2, t5 t3, t4 t8, t9 t12, t15 t13, t14
TCP-H IP-H LLCi-H MACi-H = = = =

IP-H LLC1-H MAC1-H LLC1-H FR-H LLC2-H MAC2-H LLC2-H


MACi-T FR-H FR-T

TCP-H TCP-H TCP-H TCP-H TCP-H TCP-H

Data Data Data Data Data Data MAC2-T MAC1-T FR-T

IP-H IP-H IP-H IP-H IP-H

Dr. Ramana ( I.I.T Rajasthan )

TCP header IP header LLC header MAC header

Computer Networks CS425

= MAC trailer = Frame relay header = Frame relay trailer

31 / 96

Internetworking

The Internet

Internet Protocol Stack

MIME

OSI Application
TELNET

TCP/IP

BGP

FTP

HTTP

SMTP

SNMP

Presentation Session
IGMP OSPF RSVP

Application

TCP

UDP

ICMP

Transport Transport (host-to-host) Network Data Link Physical Internet Network Access Physical

IP
BGP FTP HTTP ICMP IGMP IP MIME = = = = = = = Border Gateway Protocol File Transfer Protocol Hypertext Transfer Protocol Internet Control Message Protocol Internet Group Management Protocol Internet Protocol Multipurpose Internet Mail Extension OSPF RSVP SMTP SNMP TCP UDP = = = = = = Open Shortest Path First Resource ReSerVation Protocol Simple Mail Transfer Protocol Simple Network Management Protocol Transmission Control Protocol User Datagram Protocol

Some Protocols in the TCP/IP Protocol Suite

A Comparison of the OSI and TCP/IP Protocol Architectures


32 / 96

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

Internetworking

The Internet

IP Addresses

Network (7 bits)

Host (24 bits)

Class A

1 0

Network (14 bits)

Host (16 bits)

Class B

1 1 0

Network (21 bits)

Host (8 bits)

Class C

1 1 1 0

Multicast

Class D

1 1 1 1 0

Future Use

Class E

IPv4 Address Formats

IP Addresses: a) class A 12.190.16.54 b) class B 132.10.45.235 c) class C 201.18.1.34

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

33 / 96

Internetworking

The Internet

Subnetting

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

34 / 96

Internetworking

The Internet

(Cont.)

Subnet ID 128.96.34.0 128.96.34.128 128.96.33.0

Subnetmask 255.255.255.128 255.255.255.128 255.255.255.0

Next hop Interface 0 Interface 1 R2

Forwarding table at R1
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 35 / 96

Internetworking

The Internet

Forwarding Algorithm

1 2

D = destination of IP address for each forwarding table entry (SubnetID, Subnetmask, Nexthop)
D1 = Subnetmask & D if D1 = SubnetID
if NextHop is an interface deliver datagram directly to destination else deliver datagram directly to Next Hop

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

36 / 96

Internetworking

The Internet

(Cont.)

Subnet ID 128.96.39.0 128.96.39.128 128.96.40.0 192.4.153.0 (default)


1 2 3 4 5

Subnetmask 255.255.255.128 255.255.255.128 255.255.255.128 255.255.255.192

Nexthop Interface 0 Interface 1 R2 R3 R4

128.96.39.10 128.96.40.12 128.96.40.151 192.4.153.17 192.4.153.90

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

37 / 96

Internetworking

The Internet

CIDR - Classless Inter Domain Routing


Allocates address space (blocks) to the end users on any address bit boundary, instead of on 8-bit segments. Number of address allocated are contiguous and to be power of two. Address space aggregation is possible, thus also know as supernetting. Forwarding rule: longest prex match Net/Mask length C4.5E.2.0/23 C4.5E.4.0/22 C4.5E.C0.0/19 C4.5E.40.0/18 C4.4C.0.0/14 C0.0.0.0/2 80.0.0.0/1 Nexthop A B C D E F G

1 2 3 4 5 6

C4.4B.31.2E C4.5E.05.09 C4.4D.31.2E C4.5E.03.87 C4.5E.7F.12 C4.5E.D1.02

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

38 / 96

Internetworking

The Internet

Internet Protocol Version 4 RFC 791

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

39 / 96

Internetworking

The Internet

IP Fragmentation

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

40 / 96

Internetworking

The Internet

(Cont.)

a) Unfragmented Packet b) Fragmented packets


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 41 / 96

Internetworking

Other Important Protocols

Address Resolution Protocol (ARP) RFC 826

ARP is used to map an IP address to a hardware/physical address ARP enables each host on a network to build up a table, ARP cache, of mappings between IP and hardware addresses Entries in ARP cache are timed out periodically (in the order of 15 minutes) and removed How ARP works? When a host wants to send out an IP datagram to another host,
Checks for mapping in its ARP cache If no mapping found, broadcast an ARP request packet containing its IP /hardware addresses and IP address of the desired host Desired host, (or another system acting on its behalf) unicasts ARP reply containing the desired hosts IP and hardware addresses

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

42 / 96

Internetworking

Other Important Protocols

ARP Packet Format

ARP Operation ARP Query (0001), ARP Response (0002), RARP Request (0003), RARP Response (0004)
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 43 / 96

Internetworking

Other Important Protocols

ARP Variants
Gratuitous ARP (self ARP) A machine makes itself know to the network by sending Gratuitous ARP packet.
A gratuitous ARP packet contains the source and destination IP are both set to the IP of the machine issuing the packet and the destination MAC is ff:ff:ff:ff:ff:ff It helps in detecting IP address conicts Too many gratuitous from a node is an indication of bad Ethernet hardware/cabling

RARP Reverse ARP (RFC 903) mapping of a hardware address to an IP address. However, obsolete by the DHCP dynamic host conguration protocol. ATM ARP used in ARM networks Proxy ARP (RFC 1027) enables a machine physically located on one network appear to be logically part of a different physical network connected to the same router/rewall
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 44 / 96

Internetworking

Other Important Protocols

Router allows the server on PRIVNET to appear to be on PUBNET Router passes ARP requests and other network packets in both directions between the server machine and PUBNET Router replies (on servers behalf) with its MAC address for all ARP requests for servers MAC address from PUBNET When the server issues a who has request for any machines on PUBNET, the router provides its own MAC address
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 45 / 96

Internetworking

Other Important Protocols

Dynamic Host Conguration Protocol RFC 2131


IP addresses not only must be unique on a given internetwork, but also must reect the structure of the internetwork IP addresses must be recongurable (ex. nodes are mobile) and easily administrable Efcient address management manage a network with a range of IP addresses rather than one IP address per host DHCP allows a server to dynamically distribute IP addressing and conguration information to clients. DHCP server provides the client with at least this basic information, (IP Address, Subnet Mask, Default Gateway) DHCP deals with an important aspect of scaling Needed at least one DHCP server or relay agent per network DHCP uses UDP as transport protocol
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 46 / 96

Internetworking

Other Important Protocols

Handshaking between DHCP client and server

DHCP relay agent


Source MAC addr Client DHCPsrvr Client DHCPsrvr Dest MAC addr Broadcast Broadcast Broadcast Broadcast Source IP addr 0.0.0.0 DHCPsrvr 0.0.0.0 DHCPsrvr Dest IP addr 255.255.255.255 255.255.255.255 255.255.255.255 255.255.255.255 Packet Description DHCP Discover DHCP Offer DHCP Request DHCP ACK
47 / 96

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

Internetworking

Other Important Protocols

DHCP packet format ciddr: client IP addr, yaddr: your IP addr, saddr: server IP addr, giddr: gateway IP addr, chaddr: client hardware addr, sname: server name, xid: transaction identier, operation: DHCP Request or Reply
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 48 / 96

Internetworking

Other Important Protocols

Internet Control Message Protocol RFC 792


Error reporting and simple queries ICMP messages are sent in response to a datagram, either by a router on the path, or by the intended destination host Messages are transmitted in datagrams (delivery not guaranteed) Types of messages
TYPE 8 0 3 4 5 11 12 13/14 15/16 17/18
Dr. Ramana ( I.I.T Rajasthan )

Description Echo Request Echo Reply Destination Unreachable Source Quench Redirect Message Time Exceeded Parameter Problem Timestamp Request / Reply Information Request / Reply (No Longer Used) Address Mask Request / Reply
Computer Networks CS425 49 / 96

Internetworking

Other Important Protocols

Subtypes in Type 3 Error Messages


Code 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Destination unreachable message Description Network Unreachable Host Unreachable Protocol Unreachable Port Unreachable Fragmentation needed and DF (Dont Fragment) set Source route failed Destination Network unknown Destination Host unknown Source Host isolated Communication with Destination Network Administratively Prohibited Communication with Destination Host Administratively Prohibited Network Unreachable for Type Of Service Host Unreachable for Type Of Service Communication Administratively Prohibited by Filtering Host Precedence Violation Precedence Cutoff in Effect
Computer Networks CS425 50 / 96

Dr. Ramana ( I.I.T Rajasthan )

Internetworking

Other Important Protocols

Subtypes in Type 5 Error Messages

Code 0 1 2 3

Redirect message Description Redirect datagrams for the Network Redirect datagrams for the Host Redirect datagrams for the Type of Service and Network Redirect datagrams for the Type of Service and Host

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

51 / 96

Internetworking

Other Important Protocols

ICMP Message Formats


0 16 Checksum Unused IP Header + 64 bits of original datagram Code 8 31 0 8 16 31 Code Checksum Identifier Sequence Number Originate Timestamp (e) Timestamp

Type

Type

(a) Destination Unreachable; Time Exceeded; Source Quench

8 16 Type Code Checksum Unused Pointer IP Header + 64 bits of original datagram (b) Parameter Problem

31

Type

8 16 31 Code Checksum Identifier Sequence Number Originate Timestamp Receive Timestamp Transmit Timestamp (f) Timestamp Reply

Type

16 Code Checksum Gateway Internet Address IP Header + 64 bits of original datagram (c) Redirect

31 0

Type

8 Code Identifier

16

Checksum Sequence Number

31

(g) Address Mask Request 0 Type Code Checksum Identifier Sequence Number Optional data (d) Echo, Echo Reply 8 16 31 0 Type 8 16 31 Code Checksum Identifier Sequence Number Address Mask (h) Address Mask Reply

Dr. Ramana ( I.I.T Rajasthan )

Figure 18.9 Networks ICMP Message Computer CS425 Formats

52 / 96

Internetworking

Other Important Protocols

IPv6 RFC 2460


Large address space 128 bits ex. 1500 addresses for every square foot on the earths surface Improved option mechanism [IPv6 header] + [Extension header] + . . . [Transport-level header] Stateless auto-conguration No fragmentation at intermediate nodes, but source may fragment. Minimum MTU 1280 Bytes Address type Binary prex IPv6 notation Unspecied 00 . . . 0 (128 bits) ::/128 Loopback 00 . . . 1 (128 bits) ::1/128 Multicast 11111111 FF00::/8 Link-local unicast 1111111010 FE80::/10 Site-local unicast 1111111011 FEC0::/10 Global unicast (everything else)
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 53 / 96

Internetworking

Other Important Protocols

IPv6 Addresses
Types transmission featured by the IP addresses Unicast, Multicast, Anycast (note: no broadcasting is allowed) Types of unicast address Global unicast, Link-local unicast, Site-local unicast

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

54 / 96

Internetworking

Other Important Protocols

Transition from IPv4 to IPV6

Not possible to replace the IPv4 on every host/router on the Internet with IPv6 in one go Incremental upgrade Current approaches
Dual-stack operation Tunnelling

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

55 / 96

Internetworking

Other Important Protocols

IPv6 Header format

Fragmentation header
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 56 / 96

Internetworking

Routing on Internet

Introduction
Internet is divided into several autonomous systems (AS) Each AS is under the control of a single administrative entity

Multitier Internet Routing Architecture


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 57 / 96

Internetworking

Routing on Internet

Classication

Intradomain routing routing within an AS, use interior routing protocols such as RIP and OSPF Interdomain routing routing between ASs use exterior routing protocols such as EGP and BGP Intradomain routing algorithms
Distance vector algorithm Node sends its knowledge about the network to all its neighbours Link state routing algorithm Node broadcasts its knowledge about the neighbours to the entire network

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

58 / 96

Internetworking

Intradomian Routing

Distance Vector Routing a.k.a Bellman-Ford Algorithm

Example topology

Distance to reach by each node Node A B C D E F A 0 1 1 1 1 B 1 0 1 C 1 1 0 1 D 1 0 E 1 0 F 1 0 G 1 1

G 1 1 0

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

59 / 96

Internetworking

Intradomian Routing

Nodes periodically send updates even if none has changes Triggered updates are initiated whenever a node receives an update from others that cause it to change its routing information Count to Innity a situation that prevents the network from stabilizing Example, when a link between A and E fails, B and C advertise a distance of 2. Update cycle C B A C Solutions Take a small value for as 16 or, Split horizon dont send the routes it learned from a neighbour to that neighbour itself Example, node B may have (E,2,A), so B do not send (E,2) in the updates sent to A Do not work if routing loop involves more than 2 nodes speed of convergence is low RIP (Routing Information Protocol) implements DV algorithm
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 60 / 96

Internetworking

Intradomian Routing

Link State Routing Algorithm


Each node announces about its neighbours and the link costs to them to all the nodes in the network in LSP (link state packets) Reliable ooding: make sure that a copy of LSP sent by a node reached every other node in the network Once a node obtains network-wide knowledge, it uses Dijkstras routing algorithm (a.k.a forward search algorithm) to compute routes to all the destinations Open Shortest Path First (OSPF) is a link state approach It introduces multiple routing areas within AS (further classication within AS) OSPF messages are protected by password Routing metrics Queue lengths, hops, delay, speed, cost etc.,

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

61 / 96

Internetworking

Intradomian Routing

Dijksras shortest-path algorithm


1 2

M = {s} for each n in N {s}


1

C(n) = l (s, n) M = M {w } such that C(w ) is the minimum for all w in (N M ) for each n in (N M )
1

while (N = M )
1 2

C(n) = MIN(C(n), C(w ) + l (w , n)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

62 / 96

Internetworking

Intradomian Routing

Internet Backbone

Stub AS: connects to one other AS only Multihomed AS: connects more than one AS, but refuses to carry transit trafc Transit AS: connects more than one other AS, and carries local and transit trafc
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 63 / 96

Internetworking

Intradomian Routing

Interdomain Routing
Determine network reachability between autonomous systems Policy: prefer AS X than AS Y, prefer AS Y only if no other path, do not carry trafc between AS X and AS Y Focus on nding the best, nonlooping, policy-compliant path Challenges
Scalability (exchange of large amount of information) Impossible to calculate meaningful path costs for a path crosses multiple ASs (i.e., selecting optimal path is impossible) Trust between different ASs

Exterior gateway protocol carries the reachability information Advertises complete paths as an enumerated list of ASs to reach a particular network BGP could announce the routes, withdraw some router, or refuse to announce a route to a particular AS even if it has one
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 64 / 96

Internetworking

Intradomian Routing

Routes advertised by BGP

AS1 announce networks 192.4.54, 192.4.23, 192.12.69 can be reached on path (AS 1, AS3) to other ASs.
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 65 / 96

Internetworking

Intradomian Routing

(Cont.)

A BGP speaker per AS responsible to send network reachability information to the BGP speakers of other ASs BGP messages are carried using TCP Periodic hello messages are sent even if no update Boarder routers are one through which trafc enters and leaves an AS Interior BGP is used to redistribute the information (learned about other ASs) within an AS

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

66 / 96

Internetworking

Intradomian Routing

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

67 / 96

Internetworking

Intradomian Routing

Routing Areas in OSPF

LSPs are sent within routing area Similar to AS boarder router, area boarder routers forward routing information across routing areas Scalability often given importance over shortest-path
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 68 / 96

Transport Layer

Introduction to Transport Layer


Responsible for end-to-end packet delivery Allows multiple applications to communicate over a shared channel via multiplexing and demultiplexing Common properties
reliable message delivery (TCP) - resolving packet reordering, detect duplications, handling corrupted and dropped packets unreliable message delivery (UDP) - delivery is not guaranteed, but quick delivery support arbitrarily large messages ow control between sender and receiver entities support multiple application process on each host

These services are offered over a network providing best effort service

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

69 / 96

Transport Layer

User Datagram Protocol

User Datagram Protocol (UDP) RFC 768

correctness of the message via checksum (header + data + pseudo header srcip,dstip,protocol,udp hlen) pseudo header protects packets delivering to different destination by accidentally or incidentally

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

70 / 96

Transport Layer

User Datagram Protocol

UDP Message Queues

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

71 / 96

Transport Layer

Transmission Control Protocol

Transmission Control Protocol (TCP) RFC 793


End-to-end issues
A logical connection between the peers Variety of physical links, so different BDPs and RTTs Packet drops, packet reordering, packet corruptions Available resources at the peers and in the network may change with time

Reliable byte stream oriented transport protocol Properties of TCP


Connection oriented protocol and full-duplex connections via three-way connection setup and four-way connection close handshaking mechanisms Reliability, In-order delivery, handling of duplicate and dropped segments via sequence numbers, acknowledgements, timers, and segment retransmissions Flow control via advertising buffer sizes Congestion control via timeout events and duplicate acknowledgements
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 72 / 96

Transport Layer

Transmission Control Protocol

Connection setup Three way

System A State/(Command) CLOSED (Passive Open) LISTEN

System B State/(Command) CLOSED (Active Open) SYN SENT

System A State/(Command) CLOSED (Active Open) SYN SENT

System B State/(Command) CLOSED (Active Open) SYN SENT

SYN

SY

SY

ESTAB

SYN
ESTAB

ESTAB

ESTAB

(a) Active/Passive Open

(b) Active/Active Open

Connection Establishment Scenarios

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

73 / 96

Transport Layer

Transmission Control Protocol

(Cont.)
A
SYN i
N=i+1 SYN j , A

A initiates a connection B accepts and acknowledges

SN = i + 1, AN = j+1
(a) Normal operation

A acknowledges and begins transmission

A
SY

B
N

SYN

Obsolete SYN arrives B accepts and acknowledges


SYN
k

Connection closed Obsolete SYN i arrives


SYN

N=i+1 SYN j , A

RS T , A N=j
(b) Delayed SYN

B responds; A sends new SYN

A rejects B's connection

B discards duplicate SYN

S YN i

, AN Nk SY

=p

SN =

k+1

A initiates a connection Old SYN arrives at A; A rejects B accepts and acknowledges

B rejects segment as out of sequence

R S T, A N=k

SY

Nj

,A

N=

i+

Two-Way Handshake: Problem with Obsolete SYN Segments

SN i + 1 , AN = j+1

A acknowledges and begins transmission (c) Delayed SYN, ACK

Exaples of Three-Way Handshake

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

74 / 96

Transport Layer

Transmission Control Protocol

How TCP manages a byte stream

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

75 / 96

Transport Layer

Transmission Control Protocol

(Cont.)

Figure show data ow in one direction However, bi-directional data ow is also possible

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

76 / 96

Transport Layer

Flow Control in TCP

Flow control

At receiver
LastByteRead NextByteExpected LastByteRcvd AdvertisedWindow = MaxRcvrBuffer - ((NextByteExpected-1) LastByteRead) i.e., remaining free space at receiver

At sender
LastByteAcked LastByteSent LastByteWritten EffectiveWindow = AdvertisedWindow- (LastByteSent - LastByteAcked) i.e., data in ight must be Available buffer at receiver ( I.I.T Rajasthan ) Computer Networks CS425 77 / 96 LastByteWritten - LastByteAcked MaxSendBuff

Dr. Ramana

Transport Layer

Flow Control in TCP

Transport Entity A
...1000 1001 2400 2401...

Transport Entity B
...1000 1001 2400 2401...

A may send 1400 octets

SN = 100 1 SN = 120 1 SN = 140 1

B is prepared to receive 1400 octets, beginning with 1001

...1000 1001

1601

2401...

A shrinks its transmit window with each transmission

AN
...1000 1001 2001 2401...

,W 601 =1

000 =1

...1600 1601

2601...

SN =1 601 SN =1 8 01

B acknowledges 3 segments (600 octets), but is only prepared to receive 200 additional octets beyond the original budget (i.e., B will accept octets 1601 through 2600)

...1600 1601

2001

2601...

A adjusts its window with each credit

SN = 20 01 SN = 22 01 SN = 24 01

...1600 1601

2001

2601...

...1600 1601

2600 2601...

A exhausts its credit

AN =
4000 4001...

=1 2601,W

400

...2600 2601

4000 4001...

...2600 2601

B acknowledges 5 segments (1000 octets) and restores the original amount of credit

A receives new credit

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

78 / 96

Transport Layer

TCP Operations

TCP Header Format

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

79 / 96

Transport Layer

TCP Operations

TCP State-transition Diagram

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

80 / 96

Transport Layer

TCP Operations

TCP Policies
Send policy: Send if MSS bytes are in SendBuffer and AdvertisedWindow MSS, or send if PUSH request from application, or SendBuffer < MSS bytes and no data in ight Nagles algo Delivery policy: Wait until collecting MSS bytes into RcvrBuffer, if no PUSH from sender; otherwise deliver immediately Accept policy: Accept all segments with the receivers AdvertisedWindow (against accepting only in-order segments) Retransmission policy: Setting a timer for the entire SendBuffer. If Ack received, remove the appropriate segment from the SendBuffer and reset the timer. If timer expires, retransmit the segment at the front of the SendBuffer Acknowledgment policy: Start a delay Ack timer and wait for outbound data segment and piggyback a cumulative acknowledgment. If timeout, send an empty segment with an appropriate Ack. If delay Ack is disabled, send an Ack immediately.

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

81 / 96

Transport Layer

TCP Operations

Other issues
Sequence number wraparound
Uses 32 bits for sequence numbers and Maximum segment life time (MSL) is 120 seconds So the sequence number should not wraparound in MSL In high speed networks, say OC-48 (2.5 Gbps) time to wraparound is 14 seconds Solution: sending a timestamp in TCP optional elds

Keep the pipe full


AdvertisedWindow uses 16 bits, i,e 64K bytes If receiver has large buffer it can not advertise BDP of high speed or long delay links >> 64KB, ex. on OC-48 (2.5 Gbps) assuming 100ms RTT BDP = 29.6MB Solution: send a scaling factor, s via TCP options to advertise large window size. In such case, advertise window will be s AdvertisedWindow
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 82 / 96

Transport Layer

TCP Operations

(Cont.)
Nagles Algorithm Deals with silly window syndrome (sending segments smaller than MSS, i.e., tiny segments) Tiny segments are sent when
sender application push receiver advertises window smaller than MSS

Nagle introduces a self-clocking algorithm


1 2

When application produces data to send If available data and window (both) are MSS
1

send a full segment if there is unAcked data in ight then buffer the new data until an Ack arrives else send all new data (i.e., sending of tiny segments)

Else
1

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

83 / 96

Transport Layer

TCP Operations

(Cont.)
TCP optional elds
TCP timestamp used in RTT computations and also getting over wraparound problem Window scaling factor Selective acknowledgement (SACK)

TCP timers
TCP connection setup timer, if no Ack for SYN before timeout (75 seconds) SYN is resent Delay Ack timer 200 ms Persist timer triggered when a NULL window is advertised; if timeout sends a probe to receiver Keepalive timer tests if the other side is still up (usually 2 hours after connection goes inactive) Fin Wait 2 timer avoid a connection in Fin Wait 2 state forever 2MSL timer to make sure that FIN acking is received by the FIN sender MSL = 120 seconds Retransmission timer Adaptively update RTO interval from RTTs Karn and Jacobson algorithms
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 84 / 96

Transport Layer

TCP Operations

TCP RTO Estimation


Adaptive retransmission timeout interval Original algorithm
EstimatedRTT = EstimatedRTT + (1 - ) SampleRTT TimeOut = 2 EstimatedRTT

Karn/Partridge Algorithm
TCP stops taking samples of RTT when it retransmits a segment For each successive retransmission timeout, next timeout interval will be twice to that of the previous one (like exponential backoff)

Jacobson/Karels Algorithm
Variations in RTT samples is also taken into account Diff = SampleRTT - EstimatedRTT EstimatedRTT = (1 - ) EstimatedRTT + SampleRTT Deviation = (1 - ) Deviation + |Diff | TimeOut = EstimatedRTT + Deviation 1 = 1, = 4, = 1 8 = 4
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 85 / 96

Transport Layer

Congestion Control Mechanism

TCP Congestion Control Algorithm (CCA), RFC 1122,2581


Introduced in late 1980s by Van Jacobson Congestion collapse due to improper response to the congestion events Packet loss based CCA vs Rate based CCA Loss of an Ack or Retransmission timeout = congestion in the network Congestion window (cwnd) determines number of bytes that can be outstanding MaxWindow = MIN(CongestionWindow, AdvertisedWindow) EffectiveWindow = MaxWindow - NumberOfBytesOutStanding (i.e, LastByteSent - LastByteAcked)
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 86 / 96

Transport Layer

Congestion Control Mechanism

Updating of Congestion Window

Multiplicative/Exponential increase (MI) Phase Slow-start (SS)


Dr. Ramana ( I.I.T Rajasthan )

Additive/Linear increase (AI) Phase Congestion avoidance (CA)


87 / 96

Computer Networks CS425

Transport Layer

Congestion Control Mechanism

(Cont.)
Trasition from MI and AI via a threshold slow-start threshould ssthresh Events that trigger reduction in cwnd
Retransmission timeout Tripple duplicate Acks (fast retransmission)

How much reduction?


cwnd = 1 MSS cwnd = cwnd/2 (fast recovery)

Variants of CCA
TCP Tahoe TCP Reno TCP New reno TCP Cubic High-speed TCP TCP-Few (fractional window increase)
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 88 / 96

Transport Layer

Congestion Control Mechanism

State diagram of various TCP CC algorithms


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 89 / 96

Transport Layer

Congestion Control Mechanism

18

Congestion avoidance phase

Congestion window size (MSS)

16 14

1 0 0 1 0 1
tar tp ha se

TCP Reno and Newreno

12 10

Slo

8 6 4 2 1

TCP Tahoe

11 00 00 11 00 11

w s

1 0 0 1

11 00 00 11

11 00 00 11
14 15 16 17

Congestion window progression of TCP CC algorithms


Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 90 / 96

11 00 00 11 Congestion detected 00Slowstart threshold 11

10

11

12

13

time instance

Application Layer Protocols

Types of Applications

Internet Applications Internet Traffic

Real-time Applications Real-time or Time-critical Traffic

Non-real-time or Elastic Applications (Discrete) Data Traffic

Real-time Streaming Application Real-time Continuous Traffic

Real-time Control Applications Real-time Discrete Traffic (e.g. machine control, games) Interactive Burst Traffic

Interactive Bulk Traffic (e.g. FTP, WWW)

Asynchronous Bulk Traffic (e.g. Email, News)

Rigid and Intolerant Applications (e.g. telephony)

Tolerant and Adaptive Applications (e.g. vic, vat, webmedia)

(e.g. Telnet, X, NFS)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

91 / 96

Application Layer Protocols

Elastic Applications Based on TCP

SMTP Simple Mail Transfer Protocol IMAP Internet Message Protocol POP Post Ofce Protocol HTTP Hyper Text Transfer Protocol FTP File Transfer Protocol Popular ports: File transfer server-FTP (21), Secure Shell Server-SSH (22), Remote login server-TELNET (23), Email server-SMTP (25), Name server-DNS (53), Bootp server-DHCP (67), Web server-HTTP (80), Email Access server-POP3 (110), Email access server-IMAP (143)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

92 / 96

Application Layer Protocols

Domain Name Server - UDP based

Figure: Names translated into addresses, where the numbers 15 show the se- quence of steps in the process

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

93 / 96

Application Layer Protocols

(Cont.)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

94 / 96

Application Layer Protocols

(Cont.)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

95 / 96

Application Layer Protocols

(Cont.)

Dr. Ramana ( I.I.T Rajasthan )

Computer Networks CS425

96 / 96

You might also like