Title: Special Topics on Wireless Adhoc Networks
1Special Topics on Wireless Ad-hoc Networks
Lecture 1 Review of Computer Networking
- University of Tehran
- Dept. of EE and Computer Engineering
- By
- Dr. Nasser Yazdani Farshad Lahouti
2A tour of networking
- Goal and objective
- needs
- design
- requirement
- Whirlwind tour of networking
3Information, Computers and Networks
- Information anything that is represented in bits
- Form (can be represented) vs substance (cannot)
- Properties
- Infinitely replicable
- Computers can manipulate information
- Networks create access to information
- Potential of networking
- move bits everywhere, cheaply, and with desired
performance characteristics - Break the space barrier for information
4Objective of Networking ?
- Direct or indirect access to every other node in
the network - Connectivity is the magic needed to communicate
if you do not have a link. - Must understand many connection factors
- Traffic data rate
- Traffic pattern (bursty or constant bit rate)
- Traffic target (multipoint or single destination,
mobile or fixed) - Application requirements, Delay sensitivity Loss
sensitivity.
5Another view
- Building a network to support diverse ranges of
applications - Distributed computing.
- Multimedia.
- Telecommunication.
- E-commerce, etc.
- What kind of technology do we need?
- Hardware.
- Software.
6What is a Network?
- What is computer Network?
- Different views.
- Differences from other networks, Its generality.
- What is requirements? Different perspective
- Network provider
- Network designer
- Application programmer
7Design goals
- Connectivity
- Scalability
- Simplicity
- For designers.
- Most importantly for users.
- Efficiency
- cost
- performance
- Support for common user services.
8Levels of Networking
- Communicating across a link, LANs.
- Connecting together multiple links (Bridges)
- Finding and routing data to nodes on Internet.
- Communicating on the application level, matching
application requirements
9A First Step
- Creating a link between nodes
- Link path followed by bits
- Wired or wireless
- Broadcast or point-to-point (or both)
- Node any device connected to a link
10Types of Links
Point-to-Point
Multiple Access
11Packet Transmission Modes
- Unicast
- Transmission to single specific receiver
- Broadcast
- Transmission to all network nodes
- Multicast
- Transmission to specific subset of nodes
- Anycast
- Transmission to one of a specific subset of nodes
12What are Switched Networks?
- Switch moves bits between links
- Packet switching
- Circuit switching
Switched Network
13Back in the Old Days
14Then Came TDM
- Synchronous time division multiplexing
Multiplex (mux)
Demultiplex (demux)
15TDM Logical Network View
16Packet Switching (Internet)
Packets
17Packet Switching
- Interleave packets from different sources
- Efficient resources used on demand
- Statistical multiplexing
- General
- Multiple types of applications
- Accommodates bursty traffic
- Addition of queues
18Statistical Multiplexing Gain
- 1 Mbps link users require 0.1 Mbps when
transmitting users active only 10 of the time - Circuit switching can support 10 users
- Packet switching with 35 users, probability that
gt10 are transmitting at the same time lt 0.0017
19Characteristics of Packet Switching
- Store and forward
- Packets are self contained units
- Can use alternate paths - reordering
- Contention
- Congestion
- Delay
20Second Step Internetwork
- A collection of interconnected networks
- Host network endpoints (computer, PDA, light
switch, ) - Router node that connects networks
- Internet vs. internet
Internetwork
21Challenge
- Many differences between networks
- Address formats
- Performance bandwidth/latency
- Packet size
- Loss rate/pattern handling
- Routing
- How to translate between various network
technologies
22Third Step How To Find Nodes?
internet
Computer 1
Computer 2
23Naming
- Humans use readable host names
- E.g. www.cmu.edu
- Globally unique (can correspond to multiple
hosts) - Naming system translates to physical address
- E.g. DNS translates name to IP Address (e.g.
128.2.11.43) - Address reflects location in network
24Domain Name System
Whats the IP address for www.cmu.edu?
It is 128.2.11.43
Local DNS Server
Computer 1
DNS server address manually configured into OS
25Packet Routing/Delivery
- Each network technology has different local
delivery methods - Address resolution provides delivery information
within network - E.g., ARP maps IP addresses to Ethernet addresses
- Local, works only on a particular network
- Routing protocol provides path through an
internetwork
26NetworkAddress Resolution Protocol
Broadcast who knows the Ethernet address for
128.2.11.43?
Ethernet
Broadcast Yes, it is 08-00-2c-19-dc-45
Ethernet
27Internetwork Datagram Routing
Routers send packet to next closest point
H
R
H
R
H
R
R
R
R
H
R
H Hosts R Routers
R
H
28Routing
- Forwarding tables at each router populated by
routing protocols. - Original Internet manually updated
- Routing protocols update tables based on cost
- Exchange tables with neighbors or everyone
- Use neighbor leading to shortest path
29Fourth Step Application Demands
- Reliability
- Corruption
- Lost packets
- Flow and congestion control
- Fragmentation
- In-order delivery
- Etc
30What if the Data gets Corrupted?
Problem Data Corruption
GET windex.html
GET index.html
Internet
Solution Add a checksum
X
0,9
9
6,7,8
21
4,5
7
1,2,3
6
31What if the Data gets Lost?
Problem Lost Data
GET index.html
Internet
Solution Timeout and Retransmit
GET index.html
GET index.html
Internet
GET index.html
32What if Network is Overloaded?
Problem Network Overload
Solution Buffering and Congestion Control
- Short bursts buffer
- What if buffer overflows?
- Packets dropped and retransmitted
- Sender adjusts rate until load resources
- Called Congestion control
33What if the Data Doesnt Fit?
Problem Packet size
- On Ethernet, max IP packet is 1.5kbytes
- Typical web page is 10kbytes
Solution Fragment data across packets
GET
inde
x.ht
ml
GET index.html
34What if the Data is Out of Order?
Problem Out of Order
GET
x.th
inde
ml
GET x.thindeml
Solution Add Sequence Numbers
ml
4
inde
2
x.th
3
GET
1
GET index.html
35Network Functionality Summary
- Link
- Multiplexing
- Routing
- Addressing/naming (locating peers)
- Reliability
- Flow control
- Fragmentation
- Etc.
36What is Layering?
- Modular approach to network functionality
- The idea of divide and conquer
- Use abstraction to hide complexity.
- Example
Application
Application-to-application channels
Host-to-host connectivity
Link hardware
37Protocols
- Module in layered structure
- Set of rules governing communication between
network elements (applications, hosts, routers) - Protocols define
- Interface to higher layers (API)
- Interface to peer
- Format and order of messages
- Actions taken on receipt of a message
38Protocols
- Building blocks of a network architecture
- Each protocol object has two different interfaces
- service interface operations on this protocol
- peer-to-peer interface messages exchanged with
peer - Term protocol is overloaded
- specification of peer-to-peer interface
- module that implements this interface
39Layering Characteristics
- Each layer relies on services from layer below
and exports services to layer above - Interface defines interaction
- Hides implementation - layers can change without
disturbing other layers (black box)
40Layering
User A
User B
Application
Transport
Network
Link
Host
Host
Layering technique to simplify complex systems
41Layer Encapsulation
User A
User B
Get index.html
Connection ID
Source/Destination
Link Address
42Protocol Demultiplexing
- Multiple choices at each layer
FTP
HTTP
TFTP
NV
TCP
UDP
TCP/UDP
IP
Network
IP
IPX
Port Number
Protocol Field
Type Field
NET1
NET2
NETn
43E.g. OSI Model 7 Protocol Layers
- Physical how to transmit bits
- Data link how to transmit frames
- Network how to route packets
- Transport how to send packets end2end
- Session how to tie flows together
- Presentation byte ordering, security
- Application everything else
44OSI Layers and Locations
Application
Presentation
Session
Transport
Network
Data Link
Physical
Switch
Host
Router
Host
45Physical Layer
- Dealing with Transmission/Receiving bits.
- Encoding digital data, 0 1, on the signal
- NRZ, Manchester coding
- Framing
- Error Detection
- CRC, checksum
- Error Correction- Reliable data Transmission
- FEC- Forward Error Correction
- ARQ- Automatic Repeat Request, Stop wait, ..
46Stop and Wait
- Simplest ARQ protocol
- Send a packet, stop and wait until
acknowledgement arrives - Use sequence number to recognize repeat
Sender
Receiver
Time
Timeout
47How to Keep the Pipe Full?
- How to Keep the Pipe Full?
- Send multiple packets
- Number of pkts in flight window
- How large a window is needed
- Round trip delay bandwidth capacity of pipe
- Reliable, unordered delivery
- Several parallel stop waits
- Send new packet after each ack
- After Nack
- Go back N
- Resent the Nacked packet only
48Data Link Layer
- Three or more machines are physically connected
and communicating. - Problems
- How to connect them? Topology
- Sharing links
- How to address each machine? Addressing
- How to regulate accessing to the media?
- MAC (Media Access method or protocol)
- Collision!
- Different LAN technology
- Ethernet 85
- Token Ring 12
49Goals of MAC Protocols
MAC Protocols arbitrate access to a common shared
channel among a population of nodes
Goals 1. Fair among users 2. High
efficiency 3. Low delay 4. Fault tolerant 5-
Simple
50Multiplexing/Media Access/Sharing
- Partition the channel and give everybody a
time/freq slot - FDMA
- CDMA (Code Division Multiple Access)
- Different codes
- TDMA
- Taking turn
- Token Ring
- Random Access
- ALOHA
- CSMA, etc
- Reservation Based access or Centralized arbiter
51Examples of MAC Protocols
Packet-Switched Radio Network
Simple Random
Aloha
Carrier Sense Multiple Access/Collision Detection
Ethernet (IEEE 802.3)
Token Passing
Token Ring (IEEE 802.5) Fiber Distributed Data
Interface (FDDI)
Complex Deterministic
Wireless
52 Internetworking
- Communication between networks.
- Problems Challenges
- Different Networking technologies
(Heterogeneity). - So many Networks (Scaling).
- Some terminologies
- internetworking refer to an arbitrary
collection of connected networks. - Internet the global internetwork.
- Network either directly connected or switched
network using any LAN technology such as
Ethernet, Token ring, ATM, etc.
53Goals
- Connect existing networks
- initially ARPANET and ARPA packet radio network
- Survivability
- ensure communication service even in the presence
of network and router failures - Support multiple types of services
- Must accommodate a variety of networks
- Allow distributed management
- Allow host attachment with a low level of effort
- Allow resource accountability
54Gateway Alternatives
- Translation
- Difficulty in dealing with different features
supported by networks - Scales poorly with number of network types (N2
conversions) - Standardization
- IP over everything (Design Principle 1)
- Minimal assumptions about network
- Hourglass design
55Survivability
- Continue to operate even in the presence of
network failures (e.g., link and router failures) - As long as the network is not partitioned, two
endpoint should be able to communicate, moreover,
any other failure (excepting network partition)
should be transparent to endpoints - Decision maintain state only at end-points
(fate-sharing) - Eliminate the problem of handling state
inconsistency and performing state restoration
when router fails - Internet stateless network architecture
56IP Layering (Principle 8)
Application
Transport
Network
Link
Router
Host
Router
Host
57End-to-End Argument (Principle 2)
- Deals with where to place functionality
- Inside the network (in switching elements)
- At the edges
- Argument
- There are functions that can only be correctly
implemented by the endpoints do not try to
completely implement these at them elsewhere - Can provide a partial form as performance
enhancement - Guideline not a law
58Common View of the Telco Network
Brick
59Common View of the IP Network
60Needs some intelligence!
61IP Internet
- Concatenation of Networks or networks of
Networks. - R is routers and H is hosts.
62Service Model
- Connectionless (datagram-based)
- Best-effort delivery (unreliable service)
- packets are lost. No recover from lost.
- packets are delivered out of order
- duplicate copies of a packet are delivered
- packets can be delayed for a long time
- Datagram format
Contains all information for routing!
63IP Address Classes (Some are Obsolete)
Network ID
Host ID
8
16
32
24
Class A
Network ID
Host ID
0
Class B
10
Class C
110
Class D
Multicast Addresses
1110
Class E
Reserved for experiments
1111
64Forwarding vs. Routing
- Forwarding the process of moving packets from
input to output - The forwarding table Lookup.
- How to populate the lookup table?
- Routing process by which the forwarding table is
built and maintained - One or more routing protocols
- Procedures (algorithms) to convert routing info
to forwarding table.
65Original IP Route Lookup
- Address classes
- A 0 7 bit network 24 bit host (16M each)
- B 10 14 bit network 16 bit host (64K)
- C 110 21 bit network 8 bit host (255)
- We need to keep only network address, 221entries.
- Address would specify prefix for forwarding table
- Simple lookup
66CIDR Revisited
- Supernets
- Assign adjacent net addresses to same org
- Classless routing (CIDR)
- How does this help routing table?
- Combine routing table entries whenever all nodes
with same prefix share same hop
67What is Routing?
68What is Routing?
69What is Routing?
70How do we set up Routing Tables?
- Graph theory to compute shortest path
- Switches nodes
- Links edges
- Delay, hops cost
- Need to adapt to changes in topology
71Factors Affecting Routing
- Routing algorithms view the network as a graph
- Problem find the lowest cost path between two
nodes - Factors
- Static topology
- Dynamic load
- Policy
A
6
1
3
2
F
1
E
B
4
1
9
D
C
72Internet Routing
- Internet organized as a two level hierarchy
- First level autonomous systems (ASs)
- AS region of network under a single
administrative domain - ASs run an intra-domain routing protocols
- Distance Vector, e.g., Routing Information
Protocol (RIP) - Link State, e.g., Open Shortest Path First (OSPF)
- Between ASs runs inter-domain routing protocols,
e.g., Border Gateway Routing (BGP) - De facto standard today, BGP-4
73Example
Interior router
BGP router
AS-1
AS-3
AS-2
74Transport Layer
- First end-to-end layer
- End-to-end state
- May provide reliability, flow and congestion
control
75Why End-to-End Protocols?
- Underlying best-effort network
- drop messages
- re-orders messages
- delivers duplicate copies of a given message
- limits messages to some finite size
- delivers messages after an arbitrarily long delay
- multiple application processes on each host
- Different speed of sender and receiver (Flow
control) - Congestion in the network (Congestion controls)
- Initially, there was no end to end protocol.
76User Datagram Protocol (UDP)
- Minimal Transport Service
- Port addressing for application multiplexing
- Error detection (Checksum) formerly optional
- Connectionless end-to-end datagram service
- No flow control. No error recovery (no acks)
- Used by SNMP, DNS, TFTP, RTP, RPC, etc
16
16
16
Size in bits
16
77TCP
- Communication abstraction
- Connection oriented, Point to point
- Reliable
- Error Detection and correction
- Ordered
- Byte-stream
- Application writes bytes
- TCP sends segments
- Application reads bytes
- Full duplex, two way connection
- Flow and congestion controlled
- Protocol implemented entirely at the ends
- Fate sharing
78Whats Different From Link Layers?
- Logical link vs. physical link
- Must establish connection
- Variable RTT
- May vary within a connection
- Reordering packets
- How long can packets live ? max segment lifetime
- Cant expect endpoints to exactly match link
- Buffer space availability
- Packets in transmission, delay X bandwidth
- Transmission rate
- Dont directly know transmission rate
79TCP Header
Source port
Destination port
Sequence number
Flags
SYN FIN RESET PUSH URG ACK
Acknowledgement
Advertised window
HdrLen
Flags
0
Checksum
Urgent pointer
Options (variable)
Data
80TCP Flow Control
- TCP is a sliding window protocol
- For window size n, can send up to n bytes without
receiving an acknowledgement - When the data is acknowledged then the window
slides forward - Each packet advertises a window size
- Indicates number of bytes the receiver has space
for - Original TCP always sent entire window
- Congestion control now limits this
81TCP Congestion Control
- Underlying design principle packet conservation,
Make load udaptable - At equilibrium, inject packet into network only
when one is removed - Reaching equilibrium
- Slow start
- Eliminates spurious retransmissions
- Accurate RTO estimation
- Fast retransmit
- Adapting to resource availability
- Congestion avoidance
82TCP Congestion Control Basics
- Keep a congestion window, cwnd
- Denotes how much network is able to absorb
- Senders maximum window
- Min (advertised window, cwnd)
- Senders actual window
- Max window - unacknowledged segments
- If we have large actual window, should we send
data in one shot? - No, use acks to clock sending new data
83Self-clocking
Pr
Pb
Sender
Receiver
Ab
As
Ar
84Slow Start
- How do we get this clocking behavior to start?
- Initialize cwnd 1
- Upon receipt of every ack, cwnd cwnd 1
- Implications
- Window actually increases to W in RTT log2(W)
- Can overshoot window and cause packet loss
85Slow Start Example
86Congestion Window
Slow start with each time out
Congestion Window
Time
87Congestion Avoidance
- Loss implies congestion why?
- Not necessarily true on all link types
- If loss occurs when cwnd W
- Network can handle 0.5W W segments
- Set cwnd to 0.5W (multiplicative decrease)
- Upon receiving ACK
- Increase cwnd by 1/cwnd
- Results in additive increase
88Return to Slow Start
- If packet is lost we lose our self clocking as
well - Need to implement slow-start and congestion
avoidance together - When timeout occurs set ssthresh to 0.5w
- If cwnd lt ssthresh, use slow start
- Else use congestion avoidance
89Fast Retransmit
- Dont wait for window to drain
- Resend a segment after 3 duplicate ACKs
- remember a duplicate ACK means that an out-of
sequence segment was received - Notes
- duplicate ACKs due to packet reordering
- why reordering?
- window may be too small to get duplicate ACKs
ACK 2
cwnd 2
segment 2
segment 3
ACK 3
ACK 4
cwnd 4
segment 4
segment 5
segment 6
segment 7
ACK 4
ACK 4
3 duplicate ACKs
ACK 4
90Fast Recovery
- Each duplicate ack notifies sender that single
packet has cleared network - When lt cwnd packets are outstanding
- Allow new packets out with each new duplicate
acknowledgement - Behavior
- Sender is idle for some time waiting for ½ cwnd
worth of dupacks - Transmits at original rate after wait
- Ack clocking rate is same as before loss
91Fast Recovery
92Fast Recovery
Sent for each dupack after W/2 dupacks arrive
Sequence No
Time
93Is Layering Harmful?
- Sometimes..
- Layer N may duplicate lower level functionality
(e.g., error recovery) - Layers may need same info (timestamp, MTU)
- Strict adherence to layering may hurt performance
94Performance Metrics
- Bandwidth (throughput)
- data transmitted per time unit
- link versus end-to-end
- notation
- KB 210 bytes
- Mbps 106 bits per second
- Latency (delay)
- time to send message from point A to point B
- one-way versus round-trip time (RTT)
- components
- Latency Propagation Transmit Queuing
- Queuing time can be a dominant factor
95Latency (Queuing Delay)
The egress link might not be free, packets may be
queued in a buffer. If the network is busy,
packets might have to wait a long time.
TRANSP1
Host A
Q2
TRANSP2
How can we determine the queuing delay?
R1
PROP1
TRANSP3
R2
PROP2
TRANSP4
R3
PROP3
Host B
PROP4
96Queues and Queuing Delay
Cross traffic causes congestion and variable
queuing delay.
97A router queue
Model of router queue
Buffer
Server
A(t), l
D(t)
m
Q(t)
98A router queue (cont)
- Usually buffer size is finite
- State of the system depends on
- Packet arrival process, (Poisson, deterministic,
etc) - Packet length distribution
- The service discipline (FCFS, LCFS, priority,
etc) - of Server, service process
99A simple deterministic modelbytes or fluid
Cumulative number of bits that arrived up until
time t.
A(t)
A(t)
Cumulative number of bits
D(t)
Q(t)
m
Service process
m
time
D(t)
- Properties of A(t), D(t)
- A(t), D(t) are non-decreasing
- A(t) gt D(t)
Cumulative number of departed bits up until time
t.
100Simple deterministic model
Cumulative number of bits
d(t)
A(t)
Q(t)
D(t)
time
- Queue occupancy Q(t) A(t) - D(t).
- Queuing delay, d(t), is the time spent in the
queue by a bit that arrived at time t, and if the
queue is served first-come-first-served (FCFS or
FIFO)
101Time evolution of a queuePackets
Model of FIFO router queue
A(t), l
D(t)
m
Q(t)
Packet Arrivals
time
Departures
Q(t)
102Littles Result
103The Poisson process
- Arrival process is Poisson
- Queuing system is M/M/1, Poisson arrival,
Exponential service, - with 1 server.
- Arrival process is momeryless or arrival of
packets are - independent of each others
- Prob. of one arrival in ?t is ? ?t o(?t)
104The Poisson process (cont)
- Poisson process is a probability distribution
function. - Sp(k) 1 for all k0, 1,
- How many arrivals in t second? It is the expected
value - Skp(k) ?t
- What is interarrival time, r, between two arrival
- f(r) ?e-?r
- This is the same the service time.
- f(r) µe- µr
105The Poisson process
- Why use the Poisson process?
- It is the continuous time equivalent of a series
of coin tosses. - It is known to model well systems in which a
large number of independent events are aggregated
together. e.g. - Arrival of new phone calls to a telephone switch
- Decay of nuclear particles
- Shot noise in an electrical circuit
- It makes the math easy.
- Be warned
- Network traffic is very bursty!
- Packet arrivals are not Poisson.
- But it models quite well the arrival of new flows.
106An M/M/1 queue
- A(t) is a Poisson process with rate l, and the
time to serve each packet is exponentially
distributed with rate m, then - We assume the system is in steady state, or
stationary, with none time varying values. - Pn is the probability that there are n customer
in the queue including the one in the service. - ? l/m , ration of load on capacity, is
utilization or traffic intensity.
107An M/M/1 queue (cont)
l
l
l
l
l
l
.
n1
n
n-1
2
1
0
m
m
m
m
m
m
m
- Prob. that the system move from state n-1 to n is
l , with no departure, and probability that it
moves from state n to n-1 is m. In order the
system to be in stationary state the probability
of departure and moving state should be equal. - (l m)Pn lPn-1 mPn1
-
108An M/M/1 queue (cont)
l
l
l
l
l
.
n1
n
n-1
2
1
0
m
m
m
m
m
m
- Considering the rate of interring and leaving the
surface gives us . - Pn mPn1 gt Pn1 rPn gt Pn rnP0
- What is the value of P0?
- SnPn 1 gt P0Snrn 1 gt P0 1 r
- Pn (1 r) rn
109An M/M/1 queue
Model of FIFO router queue
A(t), l
D(t)
m
- If A(t) is a Poisson process with rate l, and the
time to serve each packet is exponentially
distributed with rate m, then