Transcript CSE331-13
CSE331:
Introduction to Networks
and Security
Lecture 13
Fall 2002
Announcements
• Reminder:
– Project 1 due on Monday, Oct. 7th
– In-class midterm Wednesday, Oct. 9th
• Monday’s Class
– Further Topics in Networking
– Review / Question & Answer
CSE331 Fall 2002
2
Recap
• Application Level Protocols
– SMTP
– HTTP
– SNMP
Today
• Congestion control
• Resource Management
• Quality of Service
CSE331 Fall 2002
3
Sharing Resources
• How do we effectively & fairly share
resources on the net?
– Bandwidth of the links
– Buffers space in routers in switches
• Many competing users
– What does “fairly” mean?
CSE331 Fall 2002
4
Contention and Congestion
• Packets contend at a router for use of a link
– Multiple packets are enqueued at the router
• Congestion is when packets are dropped
because the queue is full
– Wasted resources
– Can lead to timeouts/retransmission
• Problem is resource allocation
CSE331 Fall 2002
5
Congestion In Packet-switched Networks
Sources
Router
CSE331 Fall 2002
Destination
6
Network Resource Allocation
• Challenges
–
–
–
–
–
Distributed resources are hard to coordinate
Only way to coordinate is through the network itself!
Not isolated to single level of the protocol hierarchy
Not always possible to “route around” congestion
Bottleneck not always visible from the source
• Resource allocation
– Attempt to meet competing demands of applications
– Not always possible!
CSE331 Fall 2002
7
Flows
• A flow is a sequence of packets sent along the same
route between a source and dest.
• Connectionless Flows
– No per-flow state at the routers
– Example: Pure datagram model
• Connection Oriented Flows
–
–
–
–
Necessary per-flow state at the routers
Explicitly created/removed by signalling
Example: Virtual Circuit Switching
Potentially does not scale
• Soft-state Flows
– Some (not strictly necessary) per-flow state
– Example: Routing information in Learning Bridges
CSE331 Fall 2002
8
Multiple flows
Source
1
Dest.
1
Router
Router
Source
2
Router
Dest.
2
Source
3
CSE331 Fall 2002
9
Router- vs. Host-Centric
• Router-centric
– Each router selects packets to forward & packets
to drop
– Routers inform hosts about network conditions
• Host-centric
– Hosts observe network behavior by watching
ACKs, Timeouts, ICMP messages, etc.
– Adjust behavior accordingly
• Not mutually exclusive approaches
CSE331 Fall 2002
10
Reservation vs. Feedback
• Reservation
–
–
–
–
End hosts ask network for certain amount of capacity
If request can’t be satisfied, router rejects the flow
Examples: measure MTU or link capacities
Router-centric approach
• Feedback
–
–
–
–
End hosts send data without reserving capacity
Adjust behavior based on feedback
Explicit feedback: TCP flow control
Implicit feedback: Packet losses
CSE331 Fall 2002
11
Throughput, Delay and Load
• Network load is a measure of total link
utilization
• Ideally we would
– Maximize throughput
– Minimize delay
• Increasing #packets in network lengthens
queues, which increases delay.
• Power = Throughput/Delay
CSE331 Fall 2002
12
Throughput/Delay
Power vs. Load
Optimal Load
Load
• Ratio of Throughput/Delay as a function of network
load
• Difficult to control load in fine-grained ways
• Need stable mechanism: avoid thrashing
CSE331 Fall 2002
13
Fair Resource Allocation
• What does “Fair” mean?
– Equal share of resources for all flows?
– Proportional to how much you pay for service?
– Should we take route length into account?
Router
Router
Router
CSE331 Fall 2002
Router
14
FIFO Queuing
• First-in First-out
– Scheduling discipline: determines order
• Tail Drop
– If queue is full, most recent packet to arrive is dropped
– Drop policy: which packets are dropped
• Most widely used in Internet routers
– Pushes congestion control & resource allocation to end
hosts (TCP)
– Does not discriminate between flows
– Trusts end hosts to “share” – but no one is forced to use
TCP, for example.
CSE331 Fall 2002
15
Priority Queuing
• Simple variant on FIFO
– Use the IP Type of Service header field as a
priority
– Send all higher priority packets in the queue
before sending lower priority packets
• Problems
– Starvation of low-priority flows
– Who sets priorities? (Not end user!)
CSE331 Fall 2002
16
Fair Queing
Flow 1
Round
Robin
Flow 2
Flow 3
• Strategy
– Maintain a separate queue for each flow being
handled by the router
– Individual queues are treated FIFO with tail-drop
– Queues are handled round-robin
CSE331 Fall 2002
17
Fair Queuing Continued
• Designed to be used with end-to-end
congestion control
– Doesn’t restrict transmission rates of end hosts
– Badly-behaved end hosts only hurt themselves
• Details
– Different packet sizes complicates “fairness”
– Link is never idle (as long as there is data to send)
– If N flows are transmitting, each gets maximum of
1/N bandwidth
CSE331 Fall 2002
18
Congestion Avoidance Mechanisms
• Try to prevent congestion before it occurs
– Unlike TCP, which reacts to existing congestion
• Strategy 1: Routers watch their queues
– Routers set a bit in outgoing packets if avg. queue
length > 1
– Receiver copies bit into its ACK
– Sender increases/decreases send window based
on # of packets that report congestion
– Called the DECbit algorithm
CSE331 Fall 2002
19
Congestion Avoidance Continued
• Strategy 2: Random Early Detection
– Router monitors queue length
– If length > dropLevel then drop packet with certain
probability
– Source times out on dropped packets
– TCP causes send window to decrease
– Much tuning of parameters to optimize
performance
CSE331 Fall 2002
20
Quality of Service Issues
• Sometimes best effort is not enough
• Application requirements
– Real time: data must arrive within certain time
constraints to be useful
• Telephony, video conferencing
– Jitter (variation in arrival times of packets) is bad
• Audio/visual data need low jitter
– Packet loss:can it be tolerated or not?
• Mpeg can interpolate missing frames
• Remote robot surgeon cannot tolerate packet loss
CSE331 Fall 2002
21
Playback Buffer Example
Packet Arrival
Sequence #
Packet
Generation
buffer
delay
Playback
Time
CSE331 Fall 2002
22
Integrated Services (RSVP)
• Proposed in 1995-1997
• Service Classes
– Guaranteed arrival service
• For delay intolerant applications
• Guarantee a maximum delay
– Controlled Load
• For loss tolerant, adaptive applications
• Emulate lightly loaded network
CSE331 Fall 2002
23
Implementation Mechanisms
• Flowspecs
– Describe the kind of service needed
• “I need maximum delay of 100ms”
• “I need to use controlled load service”
• Admission Control
– Network decides whether it can provide the
desired service
• Resource Reservation
– Mechanism to exchange info about requests
• Packet Scheduling
– Manage queuing and scheduling.
CSE331 Fall 2002
24