Lecture Notes Computer Networks
Lecture Notes Computer Networks
1
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Reference Books
• Andrew S. Tanenbaum, “Computer Networks”, 4th Edition, PHI
• Andrew S. Tanenbaum, “Computer Networks”, 3rd Edition, PHI
• W. Stallings, “Data and Computer Communications”, 8th Edition,
PHI
• D. E. Comer, “Internetworking with TCP/IP Vol. 1: Principles,
Protocols, and Architecture”, 5th Edition, PHI
• B. A. Forouzan, “Data Communications and Networking”, 4th
Edition, Tata McGraw-Hill
• James F. Kurose, W. Ross, “Computer Networking: A top-down
approach featuring the Internet”, 3rd Edition, Pearson
• M. Hassan, R. Jain, “High Performance TCP/IP Networking”, PHI
• L. Garcia, I. Widjaja, “Communication Networks”, 2nd Edition,
TMH
2
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Definition
• A collection of autonomous computers
interconnected through communication media
Autonomous
Computer
user user
Communication media
user user
user
• Autonomy: all computers are controlled by themselves
• Media: copper wire, fiber optics etc.
3
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Why Networks
• Resource Sharing
– Software
» Program, Database
– Hardware
» Printer, Disk
• Load Balancing
– Program in an overloaded computer transferred to
and executed by other computer
4
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Why Networks
• High reliability
– Effects of partial failure can be overcome by
another computer
• Location independence.
– Users can access their files from anywhere in the
network.
5
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Applications
• Railway Reservation Systems
• Digital Library
• Online Newspaper
6
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Before the Internet
• Postal network.
– Delivers different types of objects (letters, packages, etc.)
world-wide.
– Relatively high delay but relatively cheap.
– Sender and receiver identified by their postal address
(name, number, street, city, etc.).
• Telephone network.
– Engineered to deliver real-time voice.
– Also world-wide.
– Low delay but more expensive.
– Users identified but telephone number.
7
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Communication Subnet
• Connecting each pair of computers through
dedicated communication media is expensive
Subnet
10
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Subnet Topology
1. Point-to-Point subnet (Peer-to-Peer)
2. Broadcast subnet
11
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Subnet Topology
• Large number of hosts may be located far away
from their nearest IMP
12
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Subnet Topology
• Design the subnet as two level hierarchy
– Backbone: consists of IMPS and high speed links
– Local access part: Concentrator, multiplexer etc.
Concentrator Terminal
Terminal Controller IMP
Host
13
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Classification of networks
• Local Area Network (LAN)
• Small network, covers few kilometers, owned by a
single organization
»TDM
»Polling
»Concentrator
15
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
FDM
• Bandwidth of the channel is much higher than
bandwidth of individual signal
Summer
T1 SCM BPF SCD R1
∑
T2 SCM BPF SCD R2
17
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TDM
• Data rate is much higher than individual device
• Create a number of logical channels by time
sharing the single available channel
18
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Polling
• A polling station sends a poll message to each
station
• If the station has data to send, it starts sending
data
• If not, sends poll reject message to controller
Shared line
Controller
19
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Hub Polling
• Stations participate in polling operation
• Controller polls the remote station
• If the station has data to send
• Sends data Star
controller
• If not
• Sends poll message to next station
• Last station sends data or poll message back to
the controller to terminate polling cycle
20
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Concentrator or Statistical TDM
T0
queue
T1
T2
Message
collection
process
Message
Tn-1
transmission
process Shared link
Tn
21
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Concentrator or Statistical TDM
• Advantage over TDM
– High utilization of outgoing link
– Supports more input devices than TDM
22
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Message transport across the subnet
• Circuit Switching
• Message Switching
• Packet Switching
23
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Circuit Switching
• Traditional concept of circuits used in telephone
system
• Three phases
1. Connection establishment
• Connection request signal
• Connection accepted signal
• Path has been chosen (N.B. the chosen path is dedicated for
that conversation)
2. Data transfer
3. Connection release: disconnection signal by any party
24
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Circuit Switching
• No store and forward delay at intermediate
node
25
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Message Switching
• No path is established
• Example: Telegram
27
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Packet Switching
• Works similar to message switching
• Places an upper bound on size of each block (called
packet)
• Sender must break the message into several packets if
size of message is larger than upper limit
• Send packets one by one
• Receiver must reassemble packets to generate original
message
• Example: Fax
28
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Packet Switching
• Effect of
packet size
• Large packet
→ large delay
• Smaller packet
→ high overhead
29
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Packet Switching
Event timing
31
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Circuit Switching Vs Packet
Switching
Circuit Switching Packet Switching
Dedicated transmission No dedicated path
path
No store and forward delay Store and forward delay at
each IMP
Each message follow same Different route for different
route packet
Bandwidth wasted Unused bandwidth may be
potentially utilized by other packets
from different sources
32
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Layering
• Building complex systems is hard!
• Approach: “Divide and conquer”
• Split job into smaller jobs, or layers
• Analogy to other fields.
• Building a house: digging, foundation, framing, etc.
• Car assembly line…
• Basic idea: each step dependent on the previous
step but does not need to be aware of how the
previous step was done.
33
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Analogy: Air Travel
• Decomposed into series of steps:
Boarding Deplane
Takeoff Landing
Traveling
34
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Layered Architecture
• Layering model is a solution to the problem of
complexity in communication networks
• Each layer solves part of the communication
problem
• Each layer is implemented independently
• Each layer provides a service to the layer above
– Relying on services provided by the layers below
35
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Layered Architecture
• Protocol: A set of rules and
conventions governing the
communication between two or more
entities
37
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The ISO OSI Model
• ISO: International Application
Provides access to the OSI environment for users
Standards Presentation
Organization Provides Independence from data representation
Session
Establish, manage, terminate connection
Physical
Transmission of raw bit stream over physical medium
38
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP/IP Reference Model
• TCP/IP: Transmission Control Protocol/Internet Protocol
39
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Comparison of OSI and TCP/IP
Model
OSI TCP/IP
Stack of independent protocols Stack of independent protocols
41
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Functions
» Framing
» Error detection and correction
» Error control
» Flow control
43
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Character count
• Bit stuffing (a) The original data (b) The data as they appear on
the line (c) The data as they are stored in receiver’s memory after
destuffing.
46
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Cyclic Redundancy Check (CRC)
• Bit strings are represented as polynomial with
coefficient 0 and 1 only
• 100101
• 1.x5+0.x4+0.x3+1.x2+0.x1+1.x0
• X5+x2+x
• Use of modulo-2 arithmetic
• Generator polynomial: Predetermined divisor
• Calculate CRC and append it to the end of the frame
• Resulting polynomial is divisible by Generator
polynomial
47
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Cyclic Redundancy Check (CRC)
• Algorithm:
1. Let r be the degree of G(x). Append r zero to
low-order-end of the frame (xrM(x)), so it
contains r+m bits
2. Divide xrM(x) by G(x) using modulo-2
arithmetic
3. Subtract the reminder from xrM(x) using
modulo-2 subtraction
4. Result is the checksumed frame to be
transmitted (T(x))
48
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Cyclic Redundancy Check (CRC)
• Example (Sender):
– M(x)=110011 (x5+x4+ x+1)
– G(x)=11001 (x4+ x3+1)
– Frame after 4 zero bits appended: 1100110000
100001
11001 1100110000
11001
10000
11001
1001
So, frame to be transmitted is 1100111001
49
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Cyclic Redundancy Check (CRC)
• Example (Receiver):
100001
11001 1100111001
11001
11001
11001
00000
So, no error.
50
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Power of CRC
• Let the receiver receives T(x)+E(x)
• E(x)=error bit string
• Each 1 bit in E(x) indicates a bit that has been inverted
• If E(x)/G(x)=0
– Error not detected
– Otherwise error will be detected
51
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Power of CRC
• Let E(x)=xi, i indicates the position of the bit
which is in error
– i.e. single bit error
52
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Power of CRC
• Let there are two isolated single bit errors
– i,.e. E(x)=xi+xj, i>j
=xj(xi-j+1)
– Assume that xj is not divisible by G(x)
– Sufficient condition for all double bit errors to be
detected => G(x) does not divide (xi-j+1)
53
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Power of CRC
• Now consider E(x) contains odd number of
error bits
– E(x) contains odd number of terms (x6+x2+1)
– No polynomial with odd number of terms has
(x+1) as a factor
– So, to detect odd number of errors G(x) must have
a factor (x+1)
54
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Error Control
• Automatic Repeat Request (ARQ):
– Detect errors at the receiving DLC layer and
request the transmitting DLC layer to retransmit
the erroneous frame
• Purpose is to turn an unreliable link into an effective
one
• ARQ has four ingredients
– Error detection
– Acknowledgement (ACK)
– Negative Acknowledgement (NACK)
– Timeout
55
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Stop and Wait ARQ
• Transmitter transmits one frame at a time
• Wait for ACK/NACK from receiver
• If ACK, transmit next frame
• If NACK, retransmit the frame
• If no ACK/NACK within timeout period
– Retransmit the frame
56
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Go-Back-N ARQ
• Frames move continuously
• Transmitter maintains buffer storage
• If receiver detects error, it sends an NACK
containing defective frame number N, discards
subsequent frames
• Transmitter goes back to frame N and
retransmits all frames starting from N
• Suitable when error rate is high
57
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Selective Repeat ARQ
• Frames move continuously
• Transmitter maintains buffer storage
• If receiver detects an error, it sends an NACK
containing defective frame number
• All subsequent frames are buffered by the
receiver
• Transmitter transmits only the defective frame
• Suitable when error rate is low
58
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Examples
60
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Sliding Window Protocol
NACK1 is sent
Frames 4 sent, closed
NACK1 is sent
Frames 4 sent, closed
64
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Notations
• C: channel capacity
• D: number of data bits per frame
• H: number of header bits per frame
• F: total number of bits per frame=D+H
• A: number of bits in ACK/NACK
• I: propagation delay in seconds
• E: probability of a bit error
• P1: Probability that a data frame is lost or
damaged
65
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Notations
• P2: probability that an ACK frame is lost or
damaged
• L: probability that a frame or its ACK is lost or
damaged
• R: average number of retransmissions per data
frame
• T: timeout interval in seconds
• W: window size
• U: channel utilization
66
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Stop and Wait ARQ
• Case 1 (Ideal Channel)
• Time required to transmit a frame=F/C Seconds
• Time required to transmit an ACK=A/C Seconds
67
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Stop and Wait ARQ • C: channel capacity
• D: number of data bits per frame
• U: channel utilization
• Now B=(L/(1-L))(F+CT)+(F+A+2CI)
• Utilization U=D/B
=D(1-L)/(LCT+F+(1-L)(A+2CI))
70
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Stop and Wait ARQ
• Case 2 (Error prone channel): • C: channel capacity
• D: number of data bits per frame
• H: number of header bits per frame
• U=D(1-L)/(F+CT)
• L: probability that a frame or its ACK is lost or
damaged
• R: average number of retransmissions per data
frame
• T: timeout interval in seconds
=D(1-L)/(F(1+CT/F)) • W: window size
• U: channel utilization
=[D/D+H]*[(1-P1)(1-P2)]*[(1/(1+CT/F))]
=U1*U2*U3
71
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Sliding Window Protocol
• Step I (Error-free channel)
• Case 1 <large window>:
– One or more ACKs will come back before window
is totally filled up
– First ACK received after t=F/C+2I Sec
– Number of frames that could be transmitted in t
seconds=1+2CI/F
– To ensure uninterrupted transmission
W>(1+2CI/F)
– So, U=D/(D+H), ignoring ACK
72
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Sliding Window Protocol
• Case 2 <small window>
– W<(1+2CI/F)
– Sender receives first ACK after (F/C+2I) seconds
– Number of data bits transmitted=W*D
– So, U=(W*D)/(F+2CI)
73
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Sliding Window Protocol
• Step II (error prone channel)
• Case 1 <selective repeat>
– Expected number of transmission per frame=1/(1-L)
74
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Sliding Window Protocol
• Case 2 <Go-back-n>:
– Expectation of X = (1 − L ) f (i )Li −1
i =1
– Where f(i)=total number of frames transmitted if the
original frame must be transmitted i times
– f(i)=1+(i-1)*N=(1-N)+N*i
– So, expectation of X=(1-L+NL)/(1-L)
– For large window N=1+2CI/F
– For small window N=W
– U=[D*(1-L)]/[(D+H)*(1-L+NL)], large window
=[(W*D)*(1-L)]/[(F+2CI)*(1-L+NL)], small window
75
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
High-Level Data Link Control
Protocol (HDLC)
• Uses bit stuffing for synchronization
77
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
High-Level Data Link Control
Protocol (HDLC)
78
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
High-Level Data Link Control
Protocol (HDLC)
79
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Point-to-Point Protocol (PPP)
• PPP provides following services:
– Framing method
– Frame format handles error detection
– Link Control Protocol (LCP)
– Bringing lines up, testing them, negotiating options, bringing
them down
– Authentication
– Defines how two devices authenticate each other
– Network Control Protocol (NCP)
– Negotiating network layer options
80
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Point-to-Point Protocol (PPP)
• Several things are missing:
– No flow control
– No error control
– Only detects error
– No sequence numbering
Frame
format
82
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Point-to-Point Protocol (PPP)
Transition phases
83
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Point-to-Point Protocol (PPP)
• Authentication protocol:
– Password Authentication Protocol (PAP)
• User sends user name and password
• System checks for validity of user name and password, accept/deny
– Challenge Handshake Authentication Protocol
(CHAP)
• Greater security than PAP
• System sends a challenge to the user
• User applies predefined function on challenge and password, sends
the result to the system
• System does the same
– If result matches, accept otherwise deny
84
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Local Area Network
85
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
LAN overview
• Small networks, covers few kilometers
• Shared medium
87
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Topology
Star Tree
Ring Bus
88
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Protocol Architecture
• Lower layers of OSI model
• Physical
90
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
LAN Protocols in Context
91
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The Channel Allocation Problem
• Static channel allocation
– No interference between users
– Efficient for small, fixed number of users
– Poses problem for large and continuously varying
number of senders
92
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Dynamic Channel Allocation
• Five key assumptions
– Station model
– Single channel assumption
– Collision assumption
– Timing assumption
– Continuous time
– Slotted time
– Channel status testing
– Carrier sensing
– No carrier sensing
93
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Pure ALOHA
98
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Carrier Sense Multiple Access
Protocol (CSMA)
• First listen for clear medium (Carrier Sensing)
• If medium is idle
– Transmit frame
– else wait
• Two stations start at the same time
– Collision
– Wait random amount of time
• Maximum utilization depends on propagation
time
– Shorter propagation gives better utilization
99
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Non-Persistent CSMA
• If medium is idle, transmit
100
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
1-Persistent CSMA
• Stations wishing transmit listens and obeys
following rules:
1. if medium is idle, transmit;
101
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
p-Persistent CSMA
• Reduces collision like non-persistent and
reduce idle time like 1-persistent
• Rules
1. If medium is idle, transmit with probability p,
and defer until next slot with probability 1-p
2. If medium is busy, continue listening
3. If collision, wait random amount of time.
102
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Throughput vs offered load
103
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
CSMA/CD
• With CSMA, collision occupies medium for
duration of transmission
104
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
CSMA/CD
CSMA/CD Operation
105
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
CSMA/CD
106
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Reservation Protocols
• Reservation can increase efficiency to 80%
– a sender reserves a future time-slot
– sending within this reserved time-slot is possible without
collision
– reservation also causes higher delays
– typical scheme for satellite links
107
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Reservation ALOHA
• two modes:
– ALOHA mode for reservation:
competition for small reservation slots, collisions possible
– reserved mode for data transmission within successful
reserved slots (no collisions possible)
collision
t
Aloha reserved Aloha reserved Aloha reserved Aloha
108
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Reservation TDMA
• Reservation Time Division Multiple Access
– every frame consists of N mini-slots and x data-slots
– every station has its own mini-slot and can reserve up to k
data-slots using this mini-slot (i.e. x = N * k).
– other stations can send data in unused data-slots according
to a round-robin sending scheme (best-effort traffic)
e.g. N=6, k=2
N mini-slots N * k data-slots
110
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Signal Encoding
111
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Ethernet MAC Sublayer Protocol
112
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Ethernet MAC Sublayer Protocol
114
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Ethernet Performance
• K stations ready to transmit
• Mean frame time = T
• Prob. of transmission during a contention slot=p
• Prob. that some station acquire the channel in
that slot A = Kp(1 − p )k −1
115
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Ethernet Performance
j =0
T
• Efficiency= 2
T+
A
1
=
2 BLe
1+
cF
116
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Ethernet Performance
117
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Ring: IEEE 802.5
118
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Ring Architecture
• A ring consists of a number of Ring Interface
Units (RIU)
• Stations are connected to RIU Station
Wiring Centre
Wiring Centre
Forward Ring
120
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Ring MAC Protocol
• Small frame (token) circulates when idle
121
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Ring MAC Protocol
• Shielded twisted pair – DM encoding
122
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Ring Operation
123
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Frame Format
1 1 1
SD AC ED
Token Format
1 1 1 2 or 6 2 or 6 No limit 4 1 1
SD AC FC Destination Source Data Checksum ED FS
address address
Frame Format
124
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Listen State
• Scan passing bit stream for patterns
– Address of attached station
– Token permission to transmit
125
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Transmit State
• Station has data
• Transmit data
• Transmit token
126
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Bypass State
• Signal propagate past repeater with no delay
(other than prop. delay)
• Improved performance
127
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Ring Management
• One station is designated as Active Monitor
(AM), others as Standby Monitor (SM)
• Functions of AM:
– Ring Initialization: PURGE MAC frame
– Lost Token: Timer
– Orphan removal: set M bit in AC byte
128
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
AM recovery
• AM sends AMP frame periodically
• If timer expires
– SM sends CLAIM TOKEN FRAME
129
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
BEACONING
• Used to isolate faulty station/ring
131
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Neighbor Notification
• AM sends AMP frame : A=0, C=0
133
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Bus Evolution
• Problem with Ethernet
– Probabilistic MAC protocol
– Worst case is unbounded
– No priority Schemes
– Important frames are held up for unimportant frames
• Solution
– Combine robustness of Ethernet and worst case behavior
of ring
– Token Bus
134
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Bus Architecture
• Stations are physically connected to a linear cable but
Logically form a ring
17 20
14
13 11 7 19
135
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Token Bus MAC Sublayer
Protocol
• Stations are added to the logical ring in order of
addresses
• To transmit a station must have the token
• Transmit for token holding time
• Pass the token to successor explicitly
• Defines four priority classes 0, 2, 4 and 6
– Each type of traffic sent for a predefined duration
– Lower priority frames can have the unused portion
of high priority traffic
136
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Frame Format
1 1 1 6 6 0-8174 4 1
Preamble Start Frame Destination Source Data Checksum End
Delimiter Control Address Address Delimiter
137
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Logical Ring Maintenance
• Joining the ring
• Token holder sends SOLICIT_SUCCESSOR frame
• The frame contains sender and its successors address
• New station bids to enter within slot time (2τ)
• If more than one station bits ----collision
– Resolved using RESOLVE_CONTENTION
138
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Logical Ring Maintenance
• Ring initialization
• First station comes on-line
• There is no traffic for certain duration
• It sends CLAIM_TOKEN frame
• If no competitor, it creates a token and sets up the ring
containing itself
140
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internetworking Devices
(a) Which device is in which layer (b) Frames, packets, and headers.
141
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internetworking Devices
• Organization’s security
– LAN interfaces have a promiscuous mode
143
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Bridges
146
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Transparent Bridges
• Operates in promiscuous mode
• Forwarding decision is made with the help of a table
• Uses backward learning algorithm
– Look at the source address to decide which machine is on
which LAN
148
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Transparent Bridges
1 2
151
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IMPComparison of 802 Bridges
Issue Transparent Bridge Source Routing Bridge
152
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Virtual LANs
153
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Virtual LANs
(a) Four physical LANs organized into two VLANs, gray and white, by
two bridges. (b) The same 15 machines organized into two VLANs by
switches
154
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Network Layer
155
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Design Issues
157
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Design Issues
• Subnets can be organized as
– Datagram Subnet
• Connectionless, packets are called datagrams
• Each packet contains full source and destination
address
– Virtual Circuit subnet
• Connection-oriented
• Virtual circuits are numbered, routers must
remember virtual circuits passing through it
• Each packet must contain virtual circuit number
158
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Design Issues
161
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Routing
162
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Routing Algorithms
• Properties:
1. Correctness 2. Simplicity 3. Robustness
4. Stability 5. Fairness 6. Optimality
• Types:
– Static or Non-Adaptive Algorithm
– Routes are computed in advance, offline
– Fails when topology changes frequently
– Dynamic or Adaptive Algorithm
– Reflects frequent changes in topology
163
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Shortest Path Routing
• Simple algorithm
• Basic idea:
• Build a graph of the subnet
– Node represents a router, arc represents a communication link
• Find the shortest path between nodes
– Dijkstra’s algorithm
– Metric: hops, delay
164
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Flooding
• Incoming packets retransmitted on every link
except incoming link
• Eventually a number of copies will arrive at
destination
– Each packet is uniquely marked, so duplicates can
be discarded
– Include a hop count in packets
165
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Flooding
166
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Distance Vector Routing
• Routing tables are updated by exchanging routing tables and re-computing
shortest path
(a) A subnet (b) Input from A, I, H, K, and the new routing table for J
167
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Distance Vector Routing
• The algorithm suffers from Count-to-Infinity problem
168
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Link State Routing
• Each router must do the following:
1. Discover its neighbors, learn their network
address
2. Measure the delay or cost to each of its
neighbors
3. Construct a packet telling all it has just learned
4. Send this packet to all other routers
5. Compute the shortest path to every other router
169
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Hierarchical Routing
• With growing size of networks routing table grows
proportionately
• Memory consumption becomes high
• More CPU time needed to scan the table
• More bandwidth required to exchange routing tables
• Solution:
– Divide routers into region
– Routers know the topology of its own region but knows nothing about
topology of the other regions
– For large networks divide regions into clusters, clusters
into zones, zones into groups……..
170
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Hierarchical Routing
171
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Broadcast Routing
Reverse path forwarding: (a) A subnet (b) a Sink tree (c) The
tree built by reverse path forwarding
172
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Multicast Routing
(a) A network (b) A spanning tree for the leftmost router (c) A multicast tree for
group 1 (d) A multicast tree for group 2
173
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Control
174
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Definition
• Too many packets in the subnet than its carrying
capacity results in congestion
175
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Factors Affecting Congestion
• Insufficient memory
– Even infinite memory makes thing worse
• Slow processor
– Queue build up
• Low bandwidth
177
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Prevention Policies
178
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Control in Virtual Circuit
Subnet
• Admission control
• Allow new circuits avoiding problem area
• Negotiate an agreement
– Reserve resources
179
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The Warning Bit
• Each router monitor utilization of outgoing line
• unew = a*uold + (1-a)*f
• If u > threshold
– The output line enters Warning state
– Each newly arrived packets are then marked
– Turn on one bit in header
– Receiver copies this information into ACK
– Sender cuts down transmission rate
180
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Choke Packets
• Tell the sender directly about congestion
• Congested router sends back choke packet
– Sender cuts down transmission rate for certain
interval
– If more choke packet received, rate is reduced
further
– If not, sender may increase the rate
181
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Hop-by-Hop Choke Packet
183
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Random Early Detection (RED)
• Take action before it is too late
• Each router maintain a running average of
queue length
• If average queue length hits threshold it starts
discarding packets randomly
– Works better when source assumes congestion for
lost packets – reduce transmission rate
– Not appropriate in wireless network
184
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Jitter Control
• Audio and video streaming require constant
transit time
• Variation in packet arrival time is called jitter
• Compute the expected transit time for each hop
• Routers check to see how much the packet is
behind or ahead of schedule
– If the packet is ahead of schedule, it is held up
– If the packet is behind of schedule, forward
immediately
185
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Quality of Service (QoS)
186
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Requirements
187
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Buffering
• To smooth out jitter, buffer packets at destination
• Increases delay
189
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The Leaky Bucket Algorithm
• Host can produce data at
rate 25MB/s
• Routers can work best
for rate 2MB/s
• Data comes in 1MB burst
• Use a leaky bucket with
ρ=2MB/s and capacity
C=1MB
191
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The Token Bucket Algorithm
• Allows output to speedup when
needed
• Leaky bucket holds token, one
token generated every ΔT sec
• Allows saving up to maximum
bucket size n
193
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Packet Scheduling
• Fair queuing gives more bandwidth to hosts
with large packets
• Use byte-by-byte round robin
194
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Resource reSerVation Protocol
(RSVP)
• Allows multiple senders to send to multiple receiver
• Uses multicast routing using spanning tree
195
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Resource reSerVation Protocol
(RSVP)
• For better reception receivers send reservation message to the sender
• Message is forwarded using reverse path forwarding
• Packets can flow without congestion
196
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internetworking
197
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Why internetworking
• Can we use a single network all over the world?
• Many different network exists
– TCP/IP, SNA, Satellite, Cellular
– Different protocols are in use
• Installation base of different networks is large and
growing
• Vendors do not want their customer to switch to
another vendors system
• Hardware development forces new software to be
created
– Computer, Telephone, Television may be interconnected
– You need different protocol
198
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
How networks differ
199
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Connecting networks
(a) Two Ethernets connected by a switch (b) Two Ethernets connected by routers
200
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Tunneling
• Encapsulating a packet inside another packet is
called tunneling
201
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Fragmentation
• Break packets into smaller fragments
– Each fragment is treated as a separate packet
• Reasons for fragmentation
• Hardware
• Operating system
• Protocols
• Desire to reduce error rate
• Prevent a packet from occupying channel too long
202
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Fragmentation
• Two strategies:
– Transparent fragmentation
• Subsequent networks are not
aware of fragmentation
• All packets must exit through same
gateway where they are
reassembled
• Overhead due to repeated
fragmentation and reassembly
– Non-transparent fragmentation
• Reassembly takes place only at the
receiver
• Overhead due to header for every
packet
• Overhead remains for rest of the
journey
• Multiple exit gateways can be used
203
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Fragmentation
• Fragments must be number carefully so that original packet can
be reconstructed
– Each fragment must contain original packet number, offset
within the original packet, end-of-packet marker
(a) Original packet, containing 10 data bytes (b) Fragments after passing through a
network with maximum packet size of 8 bytes (c) Fragments after passing through
a size 5 gateway
204
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The Internet Protocol Version 4 (IPv4)
205
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IPv4 Header
206
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Options
207
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Addresses
• IPv4 addresses are 32 bits long
– Unique and universal
– Contains two parts: network ID and Host ID
IP address formats
209
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Addresses
Special IP addresses
210
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Addresses
• Private Addresses: Some addresses are reserved for
internal use
• Packet containing private addresses are forwarded by
the routers in the Internet
212
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Subnets and Subnet Masks
• To get subnet mask, set all network bit and subnet bits
to 1
213
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Subnets and Subnet Masks
• To route packet routers perform boolean AND
operation of destination address with subnet mask
214
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Subnets and Subnet Masks
215
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Network Address Translation
(NAT)
• Question: how can a site provide multiple computers
access to Internet services without assigning each
computer a globally-valid IP address?
• Answer:
– Network Address Translation (NAT)
• Extension to IP addressing
• IP-level access to the Internet through a single IP address
• Transparent to both ends
• Implementation
– Typically software
– Usually installed in IP router
– Special-purpose hardware for high speed
216
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Network Address Translation
(NAT)
• Organization
– Obtains one globally valid address per Internet connection
– Assigns private addresses internally
– Runs NAT software in router connecting to Internet
• NAT
– Replaces source address in outgoing datagram
– Replaces destination address in incoming datagram
– Also handles higher layer protocols (e.g. TCP or UDP)
217
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Network Address Translation
(NAT)
218
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Network Address Translation
(NAT)
219
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Network Address Translation
(NAT)
• Problems
220
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Classless Inter-Domain Routing
(CIDR)
• Addresses are granted in blocks irrespective of classes
• Restriction:
– Addresses in block must be contiguous
– The number of addresses in a block must be a power of 2
– The first address must be divisible by the number of
addresses
32-28
• Number of addresses: 2 =16
223
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Classless Inter-Domain Routing
(CIDR)
• Example: An ISP is granted a block of addresses starting with
[Link]/16. The ISP needs to distribute these addresses to
three groups as follows:
– The first group has 64 customers; each needs 256 addresses
– The second group has 128 customers; each needs 128 addresses
– The third group has 128 customers; each needs 64 addresses
Group 1 Group 2
Each customer needs 256 addresses Each customer needs 128 addresses
8 bits needed to define each host 7 bits needed to define each host
Mask length 32-8=24 Mask length 32-7=25
[Link]/24 [Link]/24 [Link]/25 [Link]/25
[Link]/24 [Link]/24 [Link]/25 [Link]/25
: :
: :
[Link]/24 [Link]/24 [Link]/25 [Link]/25
224
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Classless Inter-Domain Routing
(CIDR)
• Routing table is [Link]/26
searched based on the
network address
m0
[Link]/22 m1 R1 m3 [Link]/24
• To reduce the routing
table size address m2
aggregation is used
[Link]/26
225
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Classless Inter-Domain Routing
(CIDR)
• Address Aggregation
Organization 1 [Link]/26
m0
Organization 2 [Link]/26
m1 m4 m0 R2 m1
R1
Organization 3 [Link]/26
m2
m3
Organization 4 [Link]/26
Routing Table for R1
Mask Network Address Next Hop Interface
/26 [Link] --- m0
Routing Table for R2
/26 [Link] --- m1
Mask Network Address Next Hop Interface
/26 [Link] --- m2
/24 [Link] --- m0
/26 [Link] --- m3
/0 [Link] Default m1
/0 [Link] Default m4
226
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Control Message Protocol (ICMP)
227
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Control Message Protocol (ICMP)
229
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Control Message Protocol (ICMP)
• Traceroute:
– Used to find a route to some destination
– Uses time exceeded and destination unreachable
ICMP messages
– Time exceeded is used by routers and destination
unreachable is used by receiving host (uses UDP
port 1)
230
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Control Message Protocol (ICMP)
• Example:
– traceroute [Link]
231
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
• Motivation
– Must use hardware (physical) addresses to
communicate over network
– Applications only use Internet addresses
• Example
– Computers A and B on same network
– Application on A generates packet for application
on B
– Protocol software on A must use B’s hardware
address when sending a packet
232
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
• Consequence
– Protocol software needs a mechanism that maps
an IP address to equivalent hardware address
– Known as address resolution problem
• Standard for dynamic address resolution in the Internet
• Requires hardware broadcast
• Important idea: ARP only used to map addresses
within a single physical network, never across multiple
networks
233
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
• Example:
– Machine A broadcasts ARP request with B’s IP
address
– All machines on local net receive broadcast
– Machine B replies with its physical address
– Machine A adds B’s address information to its
table
– Machine A delivers packet directly to B
234
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
235
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
• Proxy ARP: An ARP that acts on behalf of a set of hosts
236
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
• ARP message travels in data portion of network frame
• We say ARP message is encapsulated
237
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Address Resolution Protocol
(ARP)
• Cannot afford to send ARP request for each packet
• Solution
– Maintain a table of bindings
• Effect
– Use ARP one time, place results in table, and then send
many packets
• ARP table is a cache
• Entries time out and are removed
– Avoids stale bindings
• Typical timeout: 20 minutes
238
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Reverse Address Resolution Protocol
(RARP)
• Maps Ethernet address to IP address
• Disadvantage:
– RARP broadcast is not forwarded by the routers
240
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Routing Protocols in the Internet
• Although it is desirable for routers to exchange routing
information, it is impractical for all routers in an arbitrarily
large internet to participate in a single routing update protocol.
242
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Routing Information protocol
(RIP)
• Distance-vector protocol
– Uses hop count metric
• Uses split horizon and poison reverse techniques to
solve inconsistencies
• Two Forms:
– Active
– Form used by routers
– Broadcasts routing updates periodically
– Passive
– Form used by hosts
– Does not send updates
243
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Open Shortest Path First (OSPF)
• Uses Link-State Routing algorithm
• More powerful than most predecessors
• Features
– Type of service routing
– Load balancing across multiple paths
– Autonomous systems are partitioned into subsets
called areas
– Every AS has a backbone area (area 0)
– All areas are connected to area 0
– All area has an area border router
244
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Border Gateway Protocol (BGP)
• The most popular (virtually the only) EGP in use in the Internet
• Allows two autonomous systems to communicate routing
information
• Each AS designates a border router to speak on its behalf
• Uses Distance Vector Routing
• Sends path information
245
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Multicasting
• Group address: each multicast group assigned an
unique class D address
– Up to 228 simultaneous multicast groups
• Dynamic group membership
– Host can join or leave at any time
• Uses hardware multicast where available
– If not, use tunneling
• Best-effort delivery semantics (same as IP)
• Arbitrary sender (does not need to be a group member)
246
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Multicasting
• Class D addresses reserved for multicast
– [Link] through [Link]
• General form:
247
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IP Multicasting
• Mapping IP Multicasting address to hardware
multicasting address
– Place low-order 23 bits of IP multicast address in low-
order 23 bits of the special Ethernet address:
• First 25 bits are 00000001 00000000 01011110 0
• 01.00.5E.00.00.0016
– Example IP multicast address [Link] becomes Ethernet
multicast address
• 01.00.5E.00.00.0216
– Example IP multicast address [Link] becomes
Ethernet multicast address
• 01:00:5E:54:18:09
248
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Group Management protocol
(IGMP)
• Allows host to register participation in a group
• Four types of messages
– General Query, Special Query, Membership Report, Leave Report
• Message Format
249
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Group Management protocol
(IGMP)
• Joining a group:
– Hosts maintain a list group of membership
– When a process wants to join a group
• It sends request to host
• Host adds the process to to the requested group
• If this is the first process in the group, host sends a
membership report message
• If not, no need to send membership report message
250
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Group Management protocol
(IGMP)
• Leaving a group
– Host sees that no process is interested in a group
– Host sends a leave report message
– Router sends a special query message to the group
– If no response, router purges the group and sends leave
report
• Monitoring membership
– What happens if a host is removed from the network (this
the only host in the group)
• Router do not receive leave report
– Router periodically sends a general query message
– Hosts reply with membership report (may be delayed
response)
251
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Internet Group Management protocol
(IGMP)
• Encapsulation
– IGMP packet is encapsulated in an IP packet
– Value of protocol field is 2
– TTL must be 1 IGMP Message
IP Header Data
Header Data Trailer
253
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Deficiencies of IPv4
• Address depletion is a long term problem
254
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Advantages of IPv6 over IPv4
• Longer address space
• 128 bit address Vs 32 bit address
• Simplified header format
• 8 fields Vs 14 fields
• Better support for options
• Simplifies and speeds up the routing process
• Support for security
• Security is an integral part of IPv6
• Support for resource allocation
• Allows special treatment for some packets
255
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IPv6 Main Header
256
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Extension Header
257
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Extension Header for Routing
258
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
General form of IPv6 Datagram
259
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IPv6 Addresses
• Uses Hexadecimal Colon notation
• Example: dotted decimal notation
[Link].[Link].[Link].[Link]
• Becomes
68E6:8C64:FFFF:FFFF:0000:1180:096A:FFFF
• Successive zeroes are indicated by a pair of colons
• Example: FF05:0000:0000:0000:0000:0000:0000:00B3
• Becomes FF05::B3
• IPv4 addresses can be written as
– ::[Link]
260
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IPv6 Addresses
• Entire address space is divided into several
categories
• Few leftmost bits, called prefix, identifies categories
• Unicast addresses:
– Geographic based and provider based
Subnet Prefix
Subscriber Prefix
Provider Prefix
261
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IPv6 Addresses
• Multicast addresses
8 bits 4 bits 4 bits 112 bits
11111111 Flag Scope Group ID
• Reserved addresses
8 bits 120 bits
00000000 All 0s a. unspecified
262
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
IPv6 Addresses
• Local Addresses
10 bits 70 bits 48 bits
1111111010 All 0s Node address a. Link Local
263
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Transmission Control Protocol (TCP)
264
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Architectural Relationship
Application Application
Transport
TCP UDP layer
DHCP IP Layer 3
PPP Layer 2
Header contains:
source and destination
Ethernet Trailer
physical addresses;
Header
network protocol type
266
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Prime Design Goals of TCP
267
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Limitations of Internet Protocol (IP)
• Best-effort network protocol
– Packets may be lost/dropped
– Packets may be delivered out-of-order
– Packets may be duplicated
– Limits messages to some finite size
– Messages may be delayed arbitrarily long
268
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP is End-to-End
Machine A Machine B
Application Application
End-to-end
TCP TCP
IP IP
IP
Network Network
Network
Interface Interface
Interface
Router/
Gateway
Network 1 Network 2
269
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP Overview
• Used for most Internet Applications
– FTP, TELNET etc.
• Connection Oriented
– Full duplex
270
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP Overview
• Flow control
– prevent sender from overrunning receiver
• Congestion control
– prevent sender from overrunning network
272
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Connection Establishment and Termination
Active participant Passive participant
(client) (server)
273
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Flow Control
• Uses Sliding Window
• Receiver advertises window size
• As ACK’s arrive window move forward
274
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Flow Control
275
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Nagle’s Algorithm
• What happens when the application does a 1 byte write?
• Clark’s solution:
– Do not send 1 byte window update
– Wait until decent amount of space is available
277
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Acknowledgement (ACK) in TCP
• Cumulative acknowledgements
279
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Example of Cumulative ACK’s
• A new cumulative acknowledgement is generated
only on receipt of a new in-sequence packet
40 39 38 37
s d
34 35 36 37
Time flows
down
41 40 39 38
35 36 37 38
280
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Advantage Of Cumulative ACK
• If some of the ACK’s are lost, there is no harm.
281
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Delayed ACK’s
• To reduce ACK traffic, it is delayed
• An ACK is delayed until
– another packet is received, or
– delayed ACK timer expires (200 ms typical)
40 39 38 37
41 40 39 38
36 38
282
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Duplicate ACK’s
• A DUPACK is generated whenever an
out-of-order segment arrives at the receiver
40 39 38 37
(lost)
35 37
42 41 40 39
37 37
DUPACK on receipt of 38
(Above example assumes delayed acks)
283
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Duplicate ACK
• Duplicate ACKs are not delayed
• Duplicate ACKs may be generated when
– a packet is lost, or
– a packet is delivered out-of-order (OOO)
40 39 37 38
(out-of-order)
35 37
41 40 39 37
37 37
DUPACK
On receipt of 38
284
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Avoidance and Control
• Each sender maintains two windows:
285
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Avoidance and Control
• Slow Start
– Initial cwnd is set to 1
– Each new ACK doubles cwnd by 1 Segment
• Exponential Growth
287
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Avoidance and Control
25
20 Congestion Avoidance
15
ssthresh=16
cwnd
10
5
Slow Start
0
0 1 2 3 4 5 6 7 8
Time
288
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Avoidance and Control
• On a timeout
– cwnd is reduced to the initial value of 1 MSS
289
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Congestion Avoidance and Control
25
Timeout, cwnd=20
20
15 ssthresh
cwnd
10
ssthresh
0
0
10
12
14
16
18
Time
290
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP Tahoe
• Timeouts can take too long
– how to initiate retransmission sooner?
291
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP Reno
• Implements Fast Retransmit followed by Fast Recovery
• Different from timeout : slow start follows timeout
– timeout occurs when no more packets are getting across
– fast retransmit occurs when a packet is lost, but latter
packets get through
• Observations:
– Receiver is still getting TCP segments. There can’t be overwhelming
congestion.
• Concept:
– After fast retransmit, reduce cwnd by half, and continue sending
segments at this reduced level.
292
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP Reno
cwnd (initial) ssthresh
Fast Retransmit
Fast Retransmit timeout
new ACK
new ACK
Time
Slow Start Congestion Avoidance
293
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP New-Reno
• Fast recovery can result in a timeout with multiple losses per
RTT
294
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
TCP Selective ACK (TCP SACK)
• TCP acknowledgements are cumulative
– go-back-n ARQ, thus wasting bandwidth
• Advantage:
– much higher efficiency
• Disadvantage:
– more complex software in a receiver, more buffer needed at the
receiver
295
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
User Datagram Protocol (UDP)
296
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Identifying The Ultimate Destination
• IP address only specifies a computer
• Need a way to specify an application program (process)
on a computer
• Unfortunately
– Application programs can be created and destroyed rapidly
– Each operating system uses its own identification
• TCP/IP introduces its own specification
• Destination point known as port number
• Each OS binds port number to specific application
program
297
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
UDP
• Transport-layer protocol (Layer 4)
• Connectionless service: provides application programs with
ability to send and receive messages
• Allows multiple, application programs on a single machine to
communicate concurrently
• Best-effort semantics as IP
– Message can be delayed, lost, or duplicated
– Messages can arrive out of order
• Does not provide-
– Error Control
– Flow Control
298
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
UDP Message Format
299
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
UDP Pseudo Header
300
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
De-Multiplexing
301
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Remote Procedure Call (RPC)
302
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Remote Procedure Call (RPC)
• A technology in which a program on one machine invokes
procedure residing in another machine.
• Together client and server stub are responsible for hiding the fact
that procedure call is not local.
303
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
RPC steps
304
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Problems with RPC
• Passing a pointer
305
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The Real-Time Transport Protocol
(RTP)
306
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
The RTP Header
307
Bhaskar Sardar, Information Technology Department, Jadavpur University, India
Any Doubt ?
• Please feel free to
write to me:
bhaskargit@[Link]
308
Bhaskar Sardar, Information Technology Department, Jadavpur University, India