# cs425 - Slides
# cs425 - Slides
Dr. Ramana
I.I.T Rajasthan
1 / 96
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
Standalone Mainframe
Router Router
Ethernet switch
Router
LAN PCs and workstations
Information server
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
Layer 1 (Physical) Service from Layer N1
Introduction
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
5 / 96
Introduction
(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
Network Layer
Logical addressing - global address Forwarding Routing
Dr. Ramana ( I.I.T Rajasthan ) Computer Networks CS425 6 / 96
Introduction
(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
(Cont.)
8 / 96
Introduction
(Cont.)
Application services (SIP, FTP, HTTP, Telnet, ) Data translation (MIME) Encryption (SSL) Compression
MAC
Wireless link (WiFi) Wired link (Ethernet) Radio spectrum Infrared Fiber Copper
9 / 96
Introduction
Internet Protocol
TCP/IP
Application
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
Introduction
Internet Protocol
(Cont.)
User data
TCP header
TCP segment
IP header
IP datagram
Network header
Network-level packet
12 / 96
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
User data
Acknowledgement signal
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
Personal computer
C
Server
Personal computer
Personal computer
Packet-Switching Network
E
Personal computer
A
Solid line = physical link Dashed line = virtual circuit
14 / 96
(Cont.)
3 2 1
(a)
3
(b)
(c)
2 1
(d)
(e)
15 / 96
Packet Switching
3 2 1
(a)
3
(b) 3
2
(c)
3
2 1
(d)
(e)
16 / 96
VC Setup
17 / 96
Packets on VC
InVCI 5 InVCI 11
OutInterface 1 OutInterface 2
OutVCI 11 OutVCI 7
18 / 96
(Cont.)
InVCI 11 InVCI 7
OutInterface 2 OutInterface 1
OutVCI 7 OutVCI 4
19 / 96
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
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
Virtual Channels
Virtual Path
22 / 96
Headers
CS-PDU in AAL 3/4
ATM Header
24 / 96
(Cont.)
CS-PDU in AAL5
Segmentation in AAL5
25 / 96
Services
100%
0 Time
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.)
28 / 96
Internetworking
Introduction
Internet
Standalone Mainframe
Router Router
Ethernet switch
Router
LAN PCs and workstations
Information server
29 / 96
Internetworking
Introduction
(Cont.)
Subscriber connection
Residential user
Router
Internet
ATM switch
Firewall host
High-speed link
Router
Ethernet switch
ATM Network
Private WAN
Information server
30 / 96
Internetworking
Introduction
(Cont.)
LAN 1 LAN 2
Router (X)
Router (Y)
t1 t2 t3
t6 t5 t4
t7 t8
t10
LAPF
IP LLC MAC
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 = = = =
31 / 96
Internetworking
The Internet
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
Internetworking
The Internet
IP Addresses
Network (7 bits)
Class A
1 0
Class B
1 1 0
Host (8 bits)
Class C
1 1 1 0
Multicast
Class D
1 1 1 1 0
Future Use
Class E
33 / 96
Internetworking
The Internet
Subnetting
34 / 96
Internetworking
The Internet
(Cont.)
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
36 / 96
Internetworking
The Internet
(Cont.)
37 / 96
Internetworking
The Internet
1 2 3 4 5 6
38 / 96
Internetworking
The Internet
39 / 96
Internetworking
The Internet
IP Fragmentation
40 / 96
Internetworking
The Internet
(Cont.)
Internetworking
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
42 / 96
Internetworking
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
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
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
Internetworking
Internetworking
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
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
Internetworking
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
51 / 96
Internetworking
Type
Type
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
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
52 / 96
Internetworking
Internetworking
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
54 / 96
Internetworking
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
55 / 96
Internetworking
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
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
58 / 96
Internetworking
Intradomian Routing
Example topology
G 1 1 0
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
61 / 96
Internetworking
Intradomian Routing
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
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
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
66 / 96
Internetworking
Intradomian Routing
67 / 96
Internetworking
Intradomian Routing
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
These services are offered over a network providing best effort service
69 / 96
Transport Layer
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
70 / 96
Transport Layer
71 / 96
Transport Layer
Transport Layer
SYN
SY
SY
ESTAB
SYN
ESTAB
ESTAB
ESTAB
73 / 96
Transport Layer
(Cont.)
A
SYN i
N=i+1 SYN j , A
SN = i + 1, AN = j+1
(a) Normal operation
A
SY
B
N
SYN
N=i+1 SYN j , A
RS T , A N=j
(b) Delayed SYN
S YN i
, AN Nk SY
=p
SN =
k+1
R S T, A N=k
SY
Nj
,A
N=
i+
SN i + 1 , AN = j+1
74 / 96
Transport Layer
75 / 96
Transport Layer
(Cont.)
Figure show data ow in one direction However, bi-directional data ow is also possible
76 / 96
Transport Layer
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
Transport Entity A
...1000 1001 2400 2401...
Transport Entity B
...1000 1001 2400 2401...
...1000 1001
1601
2401...
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...
SN = 20 01 SN = 22 01 SN = 24 01
...1600 1601
2001
2601...
...1600 1601
2600 2601...
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
78 / 96
Transport Layer
TCP Operations
79 / 96
Transport Layer
TCP Operations
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.
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
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
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
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
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
Transport Layer
Transport Layer
(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)
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
Transport Layer
18
16 14
1 0 0 1 0 1
tar tp ha se
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
10
11
12
13
time instance
Types of Applications
Real-time Control Applications Real-time Discrete Traffic (e.g. machine control, games) Interactive Burst Traffic
91 / 96
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)
92 / 96
Figure: Names translated into addresses, where the numbers 15 show the se- quence of steps in the process
93 / 96
(Cont.)
94 / 96
(Cont.)
95 / 96
(Cont.)
96 / 96