Computer Communications and Networks
Computer Communications and Networks
and
Networks
CS 306 (2-0-2)
Dr. N. Raghu Kisore,
Assistant Professor, MEC
On the Shoulders of Giants
1961: Leonard Kleinrock published a work on packet
switching
1962: J. Licklider described a worldwide network of
computers called Galactic Network
1972: Bob Kahn and Vint Cerf invented TCP for reliable
packet transport
On the Shoulders of Giants
1973: David Clark, Bob Metcalfe implemented
TCP and designed ethernet at Xerox PARC
1975: Paul Mockapetris developed DNS system for
host lookup
1980: Radia Perlman invented spanning tree
algorithm for bridging separate networks
21st century??? What is the next big Idea?
And YOU are here
Networks in 21st century
Wired Networks
Wireless Networks
Cellular Networks
802.11b HR-DSSS
(Switch) frames
802.11a OFDM
802.11g OFDM
802.3 Ethernet
Medium Access
802.11 IR
Physical
(Hub,multiplexers
, modems) bits
Real World
TCP/IP Stack
Protocols at Various Layers
The 802.11 Protocol Stack
Comparison of Last Mile Wireless
Technologies
feature Bluetooth NFC Wi-Fi Infrared
Frequency 2.4Ghz 13.56Mhz 2.4Ghz 1-400Thz
Bandwidth Low Low High 0.75-15µ
(8kpbs) (424Kbps) (11Mbps)
Bit rate 2.1Mbps 424Kbps 600Mbps
Range 10m Few 100m <50Ft
centimeters
Security Less More secure More secure More secure
secure
Technology 802.15 ISO 13157 802.11 MISL, MISP
Operating Frequency
ISM Band (2-5GHz)
• 2.4GHz Wi-Fi (a/b/g), Bluetooth (802.15.1), NFC, ZigBee (802.15.4)
• 5GHz Wi-Fi (ac/ad/n)
• 5-6GHz 802.11p New Driverless cars
865-867 MHz (865.22MHz Z-Wave)
Smart City: TV White Space spectrum (400-600MHz)
802.22, 802.11af, 802.11a/b/g
* Other network layer protocols are Novell IPX, AppleTalk, LAN Manager,
X.25, MPLS
Service Primitives
Wireless networks.
• PSK, FSK, ASK, QPSK, QAM-16, QAM-64
NRZ-L Codes
(Non-Return-to-Zero-Level)
Uses two different voltage levels (one positive
and one negative) as the signal elements for
the two binary digits.
• 0no voltage
• 1positive voltage
NRZ-I Codes
(Non-Return-to-Zero-Inverted)
0 No Voltage transition
1Voltage transition
Manchester Coding
0 low to high transition
1 high to low transition
Differential Manchester
Previous Bit Current Bit Transition
0 0 Swap
0 1 No change
1 0 Swap
1 1 No change
Multiplexing
Improve resource usage.
Group multiple users based on a physical
attribute:
• Frequency
• Time
• Space
• Code
• Wavelength
Multiplexing
Components
• Multiplexer
• De-multiplexer
• Link
Multiplexing
Frequency Division Multiplexing
Frequency Division Multiplexing
Throughput S = G*e(-2G)
Where,
G =λ*τ Erlang is the no.of frames submitted per frame time.
f
λ frames per frame time.
Slotted Aloha
Throughput S = G*e(-G)
Where,
G =λ*τ Erlang is the no.of frames submitted per frame time.
f
λ frames per frame time.
Aloha and Slotted Aloha
G = e-1
G = (e-1)/2
802.3 Frame Format
802.11 MAC Header
802.11 Vs. 802.3 Header
MAC Address format
MM:MM:MM:SS:SS:SS
48 bit address
24 bits for manufacturer ID and 24 bits for
host ID.
Exception: 64 bit MAC address used in ZigBee
IEEE 802.15.4
MAC Address Format
Types of MAC Address
Broadcast: pkt is addressed to all nodes in the
network. FF:FF:FF:FF.FF:FF
Multicast: pkt is addressed to a specific group
of nodes. 01-00-0C-CC-CC-CC
Unicast: pkt is addressed to a specific node in
the network
Types of MAC Address
Data/Payload:
• 802.3: 46 to 1500 bytes
• 802.11: 0 to 2312 bytes
BSSID: MAC
address of the
WAP
Inter-Access Point Protocol
Client to access point associations.
AP to AP communication.
Client handoff through Mobile IP.
Physical and Data Link Layer
Bridge
Purpose of a Bridge
Interference range
Physical Layer Challenges
Communication Range
A B C
Receiver
Definition
A node is within the range of receiver but not
within range of transmitter.
Exposed Terminal Problem
Receiver
Transmitter
• Exposed Terminal.
• C is Exposed to B
Definition
A node is within the range of transmitter
(sender) but not within range of receiver.
RTS
RTS
CTS
CTS
DATA DATA
Packet Transmission
Packet Transmission
PCF and DCF
Inter frame spacing in 802.11
Wi-Fi
Basic Service Set [BSS]
• 48 bit address or BSSID
• MAC address of the 802.11 side of Access Point (AP).
Independent BSS
• Don’t need a BSSID.
• A virtual BSSID is generated.
Infrastructure BSS
• Based on an Access Point
Extended Service Set [ESS]
• Bunch of BSS’s
• BSS’s are connected by a distribution network.
• Distribution network connects the AP’s.
Equipment
Signal booster
• Physical Layer
AP switch
• Data Link Layer (Layer 2)
B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Four sources of packet delay
transmission
A
propagation
B
nodal
processing queueing
B
nodal
processing queueing
traffic intensity
= La/R
La/R ~ 0: avg. queueing delay small La/R ~ 0
La/R -> 1
Sliding Window Protocol
Stop-and-Wait
• Wt=1, Wr=1
Go-Back-N
• Wt>1, Wr=1
Selective repeat
• Wt>1, Wr>1
Stop-and-Wait Protocol ARQ
(Wt=1, Wr=1)
the sender sends out one frame, waits for
acknowledgment before sending next frame, thus
the name Stop-And-Wait.
Highly inefficient in networks with unusually long
delay.
• Ex: 3 and 22 minutes for earth-to-mars comm.
• Ex: 17 hours, 15 minutes for earth-to-voyager comm.
Stop-and-Wait Protocol ARQ
(Wt=1, Wr=1)
Go-Back-N ARQ
(Wt>1, Wr=1)
Go-Back-N ARQ
(Wt>1, Wr=1)
WS=WR = 2m-1
WS, WR are the sending and receiving window sizes.
m is the number of bits allocated for sequence number.
Network Layer
Internet Protocol (IP)
Addressing schemes
Network partitioning.
CIDR.
IPv4
IPv6
IANA
Routing decisions
Routing Protocols
Autonomous systems, inter and intra domain routing
IPv4 Header
IPv4 Address Scheme
Private IP address
Other Info
Loopback: 127.0.0.1
Broad Cast: All 1’s
– Example: 192.168.1.255
– 195.1.1.0/26
Link State
• OSPF or IS-IS
IPv6
128 bit address.
Example:
2001:0000:3238:DFE1:0063:0000:0000:FEFB
Rules:
• Discard leading Zero(es)
• If two of more blocks contain consecutive zeroes, omit
them all and replace with double colon sign.
• A single block of zeroes are represented by single 0
Above address is represented as
• 2001:0:3238:DFE1:63::FEFB
IPv6 address format
Using NIC address to generate EUI-64 Interface
ID.
Conversion of EUI-64 ID into IPv6 Interface
Identifier.
Global Unicast Address.
EUI-64 Interface ID
IPV6 Interface ID
Types of IPv6 addresses
Link-Local Address
• scope is limited to the segment and hence a
router will never forward/route these packets
Unique-Local Address
• are locally global, but are not routed over the
Internet and their scope is limited to an
organization’s boundary
Connection closing
• 4-way handshake
TCP Header
UDP Header
Differences between TCP & UDP
Congestion Control
BW * delay product
Additive Increase Multiplicative Decrease
Congestion detection.
Congestion avoidance
Variants of TCP
• TCP RED, TCP Vegas
Traffic Shaping and SLA
• Token bucket
• Leaky bucket
State Transition Diagram
Connection Establishment
Connection setup:
3 way handshake
Closing Connection
Socket Programming
TCP Congestion Management
Slow Start,
Congestion Avoidance,
Fast Retransmit and
Fast Recovery
End-to-end
Congestion Control
Network as black box
• TCP congestion-avoidance algorithm
Network
Window Size Packet Loss,
Or Round trip time,
Rate or
Throughput
Packet Loss Based
Congestion Control
TCP Congestion Control
(Read Van Jacobson, “Congestion Avoidance and Control,” Sigcomm’88)
Transmission Control Protocol (TCP)
Startup
Before
Stabiliza.
TCP Tahoe
– performs fast retransmit of lost packet on RTO time out
TCP Reno
– Improves on TCP Tahoe by doing fast recovery in
response to 3 DUP-ACKS
– Avoids slow start phase
Point-to-Point
Congestion Control
Active Queue Management Techniques
(Box is Green)
Queuing
Happens at intermediate routers.
Quality of Services
Goals of Active Queue
Management
The primary goal: Controlling average queuing
delay, while still maintaining high link utilization.
Secondary goals:
• Improving fairness (e.g., by reducing biases against
bursty low-bandwidth flows).
• Reducing unnecessary packet drops.
• Reducing global synchronization (i.e., for environments
with small-scale statistical multiplexing).
• Accommodating transient congestion (lasting less than a
round-trip time).
Queue Management Techniques
When to start dropping packets?
Advantages:
• Lower average queuing delay.
• Avoids penalizing streams with large bursts.
• Desynchronizes co-existing flows.
RED Algorithm
Variables: Parameters:
qavg, pa minth, maxth
RED Drop Probabilities
Why use average Queue Size?
To be robust against transient bursts:
• When there is a transient burst, to drop just
enough packets for end-to-end congestion control
to come into play.
• To avoid biases against bursty low-bandwidth
flows.
• To avoid unnecessary packet drops from the
transient burst of a TCP connection slow-starting.
Disadvantages of RED
Parameter sensitivity:
• How to set minth, maxth and maxp?
Goal is to maintain mean queue size below the
midpoint between minth and maxth in times of
normal congestion.
maxth needs to be significantly below the
maximum queue size, because short-term
transients peak well above the average.
maxp primarily determines the drop rate. Needs
to be significantly higher than the drop rate
required to keep the flows under control.
RED Drop Probabilities
(alternative)
Other AQM schemes
Adaptive RED (ARED)
Proportional Integral (PI)
Virtual Queue (VQ)
Random Exponential Marking (REM)
Dynamic-RED (DRED)
Blue
Many other variants... (a lot of PhDs in this area!)
Explicit Congestion Notification
(ECN)
Standard TCP:
• Losses needed to detect congestion.
• Wasteful and unnecessary.
ECN:
• Routers mark packets instead of dropping them.
• Receiver returns marks to sender in ACK packets.
• Sender adjusts it’s window as it would have done if
the packet had been dropped.
Advantages:
• Bandwidth up to bottleneck not wasted.
• No delay imposed by retransmission.
ECN: Backwards Compatibility
When congestion experienced, a bit in the IP
header indicates if both hosts implement ECN.
- If they do, router marks packet.
– If they don’t, router drops packet.
ECN Notification
Before After
Token Bucket
The Token Bucket Algorithm compare to Leaky
Bucket Algorithm allow the output rate vary
depending on the size of burst.
In this algorithm the buckets holds token to
transmit a packet, the host must capture and
destroy one token.
Tokens are generated by a clock at the rate of one
token every Δt sec.
Idle hosts can capture and save up tokens (up to
the max. size of the bucket) in order to send larger
bursts later.
Token Bucket algorithm
1. A token is added at every Δt time.
2. The bucket can hold at most b-tokens. If a token arrive
when bucket is full it is discarded.
3. When a packet of m bytes arrived m tokens are removed
from the bucket and the packet is sent to the network.
4. If less than n tokens are available no tokens are removed
from the buckets and the packet is considered to be non
conformant.
The non conformant packet may be enqueued for subsequent
transmission when sufficient token have been accumulated in the
bucket.
If C is the maximum capacity of bucket and ρ is the arrival rate and
M is the maximum output rate then Burst Length S can be
calculated as C + ρS = MS
Differences
Token Bucket Leaky Bucket
Token dependent. Token independent.
If bucket is full token are If bucket is full packet or
discarded, but not the packet. data is discarded.
Packets can only transmitted Packets are transmitted
when there are enough token continuously.
It allows large bursts to be sent It sends the packet at
faster rate after that constant rate constant rate
It saves token to send large bursts. It does not save token.
Application Layer
Key Protocols
DHCP
DNS,
• Hierarchy tree, TLDs
SNMP
• NMS, FCAPS, MIB, V2 and V3
HTTP/HTTPS, FTP,
SMTP,POP3