SlideShare a Scribd company logo
Lecture 10: TCP Friendliness, DCCP, NATs, 
and STUN
TCP Friendliness
Congestion Control 
 TCP dynamically adapts its rate in response to 
congestion 
 AIMD causes flows to converge to fair goodput 
 But how do losses (e.g., bit errors) affect goodput? 
 What about UDP?
Chiu Jain Phase Plots 
Flow A rate (bps) 
Flow B rate (bps) 
Fair 
A=B 
Efficient 
A+B=C 
overload 
underload 
t1 
t2 
t3 
t4 
t5 
t6
Responding to Loss 
 Set threshold to cwnd 
2 
 On timeout 
- Set cwnd to 1 
- Causes TCP to enter slow start 
 On triple duplicate ACK (Reno) 
- Set cwnd to cwnd 
2 
- Retransmit missing segment 
- Causes TCP to stay in congestion avoidance
Analyzing TCP Simply 
 Assume all segments are MSS long 
 Assume a packet loss rate p 
 Assume a constant RTT 
 Assume p is small (no timeouts)
Analysis 
 Window size W cuts to W 
2 after a loss 
 Grows to W after W 
2 RTTs 
 Goodput = 3 
4 W MTU  1 
RTT
Window Size 
 p = 1 
(W 
2 +(W 
2 +1)+:::+W) 
 p  1 
3 
8W2 
 W  
q 
8 
3p 
 Goodput = 3 
4  
q 
8 
3p MTU  1 
RTT 
 Goodput = 1:22MTU 
p 
p 
RTT 
 Constant factor changes based on delayed acks, 
etc.
TCP Friendliness 
 Don’t want other protocols to disrupt TCP 
 UDP happily shuts down TCP flows 
 “TCP friendliness:” obeying TCP congestion 
control as per prior goodput equation 
- Does not imply acting like TCP 
- E.g., does not require abrupt window changes
ledbat WG 
 “The LEDBAT WG is chartered to standardize a 
congestion control mechanism that should saturate 
the bottleneck, maintain low delay, and yield to 
standard TCP.” 
 TCP-friendliness is insufficient for modern P2P 
applications 
- Flow fairness, not application fairness 
- TCP fills queues 
 Elastic workloads vs. inelastic workloads
DCCP
DCCP 
 Datagram Congestion Control Protocol (DCCP) 
provides congestion control for unreliable 
datagrams (RFC 4340) 
 Connection-oriented protocol 
- Request-response-ack establishment 
- Close-reset or CloseReq-Close-reset teardown 
 Counts packets, not bytes
DCCP Segment
Sequence Numbers 
 Every DCCP packet uses a new sequence number 
- Data 
- Acknowledgements 
- Control traffic 
 Acknowledgements are for last packet received 
- Not cumulative acknowledgements 
- Does not succinctly describe connection history 
- Options can give packet vectors
Synchronization 
 DCCP uses sequence number windows to protect 
from attacks 
 Large bursts of losses cause packets to fall past 
windows 
 Need to resynchronize
Synchronization Exchange
Synchronization on Reset Problem
Synchronization on Reset Solution
Congestion Control 
 Defines Congestion Control IDs (CCIDs) 
 Negotiated with change/confirm L/R options 
 Each half-connection can have different 
congestion control 
 CCID 2: TCP congestion control (AIMD) (RFC 
4941) 
 CCID 3: TCP-friendly congestion control (RFC 
4942)
CCID 2 
 Uses TCP congestion control 
- Maintains a cwnd, slow-start, etc. 
 Adds congestion control to acks 
- Sender specifies an AckRatio, R 
- Ratio of data to ack packets (TCP with delayed ACKs is 2) 
- On detecting ack losses, double R 
- After cwnd 
R2R lossless congestion windows, decrement R
CCID 3 
 Uses TCP-friendly congestion control 
 Uses a sending rate, rather than a congestion 
window 
 Receiver sends feedback once per RTT, reporting 
loss rate 
 If sender hears no feedback, halves sending rate 
 Security issue with loss rate reporting: report loss 
intervals, rather than just a loss rate, verifiable 
with ECN nonces
DCCP Today 
 Numerous implementations 
 IETF Standards Track 
 Well suited to VoIP, Internet Gaming, etc. 
 Sees very little use
2-minute stretch
Network Address Translator
NAT 
 Network Address Translator 
NAT 
(128.34.22.8) 
Client A 
(10.0.0.101) 
NAT 
(76.18.117.20) 
Client B 
(10.1.1.9) 
Session A-S 
10.0.0.101:1234 
18.181.0.31:22 
Session B-S 
10.1.1.9:5411 
18.181.0.31:22 
Server 
(18.181.0.31) 
Session B-S 
76.18.117.20:10001 
18.181.0.31:22 
Session A-S 
128.34.22.8:6101 
18.181.0.31:22
Motivations and Complications 
 There are only 232 IP addresses 
 Firewalls for security 
 Breaks end-to-end (node does not know its 
external IP) 
 Node might not even know if it’s behind a NAT 
 NAT needs to be able to dynamically assign 
mappings
How a NAT Works 
 Maps between global and local (IP,port) pairs 
 Requires knowledge of transport packet format 
 UDP datagram, TCP SYN 
- Can shut down TCP mapping on FIN+ACK 
- UDP requires timeouts ( 2 minutes, unless IANA says 
otherwise) 
 RFC 4787/BCP 127 defines recommended 
behaviors
NAT Example, Step 1 
NAT 
(128.34.22.8) 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
Client B 
(10.1.1.9)
NAT Example, Step 2 
NAT 
(128.34.22.8) 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
10.1.1.18 
18.181.0.31 
4512 80 
Client B 
(10.1.1.9) 
Client A tries to open 
a connection to Server 
port 80 from port 4512
NAT Example, Step 3 
NAT 
(128.34.22.8) 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
Client B 
(10.1.1.9) 
NAT rewrites the source 
address and port so it 
seems it is the source 
128.34.22.8 
18.181.0.31 
6641 80 
10.1.1.18 
18.181.0.31 
4512 80
NAT Example, Step 4 
NAT 
(128.34.22.8) 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
Client B 
(10.1.1.9) 
NAT also creates a mapping 
so it can transform future 
packets correctly 
18.181.0.31 
10.1.1.18 
4512 
80 
128.34.22.8 
6641
NAT Example, Step 5 
NAT 
(128.34.22.8) 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
18.181.0.31 
Client B 
(10.1.1.9) 
Server responds to SYN 
with SYN+ACK and NAT 
rewrites it 
18.181.0.31 
128.34.22.8 
80 6641 
10.1.1.18 
80 4512 
18.181.0.31 
10.1.1.18 
4512 
80 
128.34.22.8 
6641
NAT Example, Step 6 
NAT 
(128.34.22.8) 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
18.181.0.31 
Client B 
(10.1.1.9) 
Client B can also open 
a connection, and the NAT 
creates a mapping for it too 
18.181.0.31 
128.34.22.8 
80 4050 
10.1.1.19 
80 9967 
18.181.0.31 
10.1.1.19 
9967 
80 
128.34.22.8 
4050
NAT Example, Step 7 
Client A 
(10.1.1.18) 
Server 
(18.181.0.31) 
In the case of TCP, NAT 
can discard the mapping 
on close or RST 
RST RST 
NAT 
(128.34.22.8) 
18.181.0.31 
Client B 
(10.1.1.9) 
18.181.0.31 
128.34.22.8 
80 6641 
10.1.1.18 
80 4512 
18.181.0.31 
10.1.1.18 
4512 
80 
128.34.22.8 
6641
Types of NAT (RFC 3849) 
 Full Cone: no ingress filter (single local-external 
mapping) 
 Restricted Cone: ingress filter on address 
 Port Restricted: ingress filter on address/port 
 Symmetric: different mappings for different 
external destinations 
 Teminology is imperfect (static port mappings, 
etc.)
NAT Problems 
 Incoming TCP connections 
 E.g., Skype 
clients 
super 
nodes 
bootstrap 
call super node 
relay
TCP Through NATs 
 Server socket doesn’t initiate traffic: NAT can’t set 
up mapping 
 Rendezvous servers (as in Skype) 
 Connection reversal through rendezvous if only 
one is behind a NAT (rendezvous server asks 
un-NAT node to open a port so NAT node can 
connect)
TCP Reversal
More NAT Problems 
 Port mapping: 0-1023 should map to 0-1023 
 Port parity: even port!even port, odd port!odd 
port (RFC 3550: RTP uses even, RTCP uses odd)) 
 Hairpinning: packet from inside NAT can send 
packets to external (NAT) address and have 
portmap work
RFC 4787 and Hairpinning 
 “NAT UDP Unicast Requirements” 
- F. Audet and C. Jennings (guest lecture last year) 
More formally, a NAT that supports hairpinning forwards packets 
originating from an internal address, X1:x1, destined for an external 
address X2':x2' that has an active mapping to an internal address 
X2:x2, back to that internal address, X2:x2. Note that typically X1' 
is the same as X2'. 
Furthermore, the NAT may present the hairpinned packet with either an 
internal (X1:x1) or an external (X1':x1') source IP address and port. 
Therefore, the hairpinning NAT behavior can be either External 
source IP address and port or Internal source IP address and port. 
Internal source IP address and port may cause problems by confusing 
implementations that expect an external IP address and port.
Example confusion 
 Two nodes (A, B) share a switch behind a NAT 
 A sends TCP SYN to an external address for B 
 B responds with SYN+ACK 
 What can happen if NAT did not rewrite A’s SYN 
to have an external address and port? Will B’s 
packet traverse the NAT?
Simple Traversal of UDP through NATs
STUN (RFC 3849) 
 “Simple Traversal of User Datagram Protocol 
(UDP) Through Network Address Translators 
(NATs)” 
 Enables a node to 
- Determine if it is behind a NAT, and if so, what kind 
- Obtain a public IP address/port pair 
 Client-server protocol, requires no changes to 
NATs 
 STUN server coordinates
STUN Binding Requests 
 Node sends BR to STUN server 
 STUN sends a response that has the address and 
port it sees 
- If different than node’s local address and port, it’s behind a 
NAT 
 Node can probe to see what kind of NAT 
- Ask STUN server to respond from different address: no 
response, address restricted; different response, symmetric 
- Ask STUN server to respond from different port: no 
response, port restricted 
 When does STUN not work?
NAT Hole-Punching 
 STUN doesn’t work when 
- A or B are behind symmetric NAT 
- A and B are behind same NAT without hairpinning 
- What about restricted cone, port-restricted NATs? 
 Parallel approaches 
- A and B report their local IP address to server Sx 
- Server tells the other the address/port pair (L;G) 
- A tries to send UDP packets to (LB;GB) using LA 
- B tries to send UDP packets to (LA;GA) using LB
NAT Hole-Punching Example 
Client A 
(10.0.0.101) 
NAT 
(76.18.117.20) 
Client B 
(10.1.1.9) 
Server 
(18.181.0.31) 
NAT 
(128.34.22.8)
NAT Hole-Punching Example 
1. Request 
connection to B 
Client A 
(10.0.0.101) 
NAT 
(76.18.117.20) 
Client B 
(10.1.1.9) 
Server 
(18.181.0.31) 
NAT 
(128.34.22.8)
NAT Hole-Punching Example 
Client A 
(10.0.0.101) 
Server 
(18.181.0.31) 
2a. S sends LB 
and GB to A 
2b. S sends LA 
and GA to B 
NAT 
(76.18.117.20) 
Client B 
(10.1.1.9) 
NAT 
(128.34.22.8)
NAT Hole-Punching Example 
Client A 
(10.0.0.101) 
Server 
(18.181.0.31) 
3a. A sends to 
LB and GB 
3b. B sends to 
LA and GA 
NAT 
(76.18.117.20) 
Client B 
(10.1.1.9) 
NAT 
(128.34.22.8)
NAT Hole-Punching Example 
Client A 
(10.0.0.101) 
Client B 
(10.1.1.9) 
Server 
(18.181.0.31) 
NAT 
(76.18.117.20) 
NAT 
(128.34.22.8) 
4. Session A-B 
established
Multiple NAT Layers 
 Common for consumer Internet: ISP has internal 
NAT, end user places another NAT 
 Requires hairpinning at ISP NAT 
Client A 
(10.0.0.101) 
UserNAT 
(192.168.3.7) 
Client B 
(10.1.1.9) 
ISP NAT 
(18.181.0.31) 
User NAT 
(192.168.4.1) 
Internet 
ISP Network
The New Hourglass 
Layers 5-7 
TCP 
UDP ICMP 
IP 
Layers 1-2
Class Administrative Stuff
So, the midterm...
Midterm Grades 
 A: 80-100 
 B: 60-79 
 C: 50-59 
 D: 40-59 
 F: 40 
 Don’t forget two-thirds rule on final grade, final 
exam can trump midterm
Travel:W-F 
 Guest lectureWednesday: David Mazi´eres 
- Topic: IPv6, multicast, anycast 
 Phil’s office hours: Today 2:05-3

More Related Content

What's hot

RIP RTCP RTSP
RIP RTCP RTSPRIP RTCP RTSP
RIP RTCP RTSP
Dev Heba
 
Computer network
Computer networkComputer network
Computer network
DeepikaT13
 
Rtsp
RtspRtsp
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)
NYversity
 
RTP
RTPRTP
7.protocols 2
7.protocols 27.protocols 2
7.protocols 2
Marian Marinov
 
Introduction to SCTP and it's benefits over TCP and UDP
Introduction to SCTP and it's benefits over TCP and UDPIntroduction to SCTP and it's benefits over TCP and UDP
Introduction to SCTP and it's benefits over TCP and UDP
VIJAY SHARMA
 
Computer network (Lecture 2)
Computer network (Lecture 2)Computer network (Lecture 2)
Computer network (Lecture 2)Vishwajit Nandi
 
Course on TCP Dynamic Performance
Course on TCP Dynamic PerformanceCourse on TCP Dynamic Performance
Course on TCP Dynamic Performance
Javier Arauz
 
CS 6390 Project design report
CS 6390 Project design reportCS 6390 Project design report
CS 6390 Project design reportRaj Gupta
 
Chap 13 stream control transmission protocol
Chap 13 stream control transmission protocolChap 13 stream control transmission protocol
Chap 13 stream control transmission protocol
Noctorous Jamal
 
CS 6390 Project design report
CS 6390 Project design reportCS 6390 Project design report
CS 6390 Project design reportAbhishek Datta
 
Real-Time Streaming Protocol
Real-Time Streaming Protocol Real-Time Streaming Protocol
Real-Time Streaming Protocol
Jayaprakash Nagaruru
 
9 ipv6-routing
9 ipv6-routing9 ipv6-routing
9 ipv6-routing
Olivier Bonaventure
 
TCP & UDP Streaming Comparison and a Study on DCCP & SCTP Protocols
TCP & UDP Streaming Comparison and a Study on DCCP & SCTP ProtocolsTCP & UDP Streaming Comparison and a Study on DCCP & SCTP Protocols
TCP & UDP Streaming Comparison and a Study on DCCP & SCTP Protocols
Peter SHIN
 
Sania rtp
Sania rtpSania rtp
Sania rtp
saniacorreya
 

What's hot (20)

RIP RTCP RTSP
RIP RTCP RTSPRIP RTCP RTSP
RIP RTCP RTSP
 
RTP.ppt
RTP.pptRTP.ppt
RTP.ppt
 
Computer network
Computer networkComputer network
Computer network
 
Rtsp
RtspRtsp
Rtsp
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)
 
Sctp tutorial
Sctp tutorialSctp tutorial
Sctp tutorial
 
RTP
RTPRTP
RTP
 
7.protocols 2
7.protocols 27.protocols 2
7.protocols 2
 
Chap05 gtp 03_kh
Chap05 gtp 03_khChap05 gtp 03_kh
Chap05 gtp 03_kh
 
Introduction to SCTP and it's benefits over TCP and UDP
Introduction to SCTP and it's benefits over TCP and UDPIntroduction to SCTP and it's benefits over TCP and UDP
Introduction to SCTP and it's benefits over TCP and UDP
 
Computer network (Lecture 2)
Computer network (Lecture 2)Computer network (Lecture 2)
Computer network (Lecture 2)
 
Course on TCP Dynamic Performance
Course on TCP Dynamic PerformanceCourse on TCP Dynamic Performance
Course on TCP Dynamic Performance
 
CS 6390 Project design report
CS 6390 Project design reportCS 6390 Project design report
CS 6390 Project design report
 
Chap 13 stream control transmission protocol
Chap 13 stream control transmission protocolChap 13 stream control transmission protocol
Chap 13 stream control transmission protocol
 
CS 6390 Project design report
CS 6390 Project design reportCS 6390 Project design report
CS 6390 Project design report
 
Real-Time Streaming Protocol
Real-Time Streaming Protocol Real-Time Streaming Protocol
Real-Time Streaming Protocol
 
9 ipv6-routing
9 ipv6-routing9 ipv6-routing
9 ipv6-routing
 
RTP & RTCP
RTP & RTCPRTP & RTCP
RTP & RTCP
 
TCP & UDP Streaming Comparison and a Study on DCCP & SCTP Protocols
TCP & UDP Streaming Comparison and a Study on DCCP & SCTP ProtocolsTCP & UDP Streaming Comparison and a Study on DCCP & SCTP Protocols
TCP & UDP Streaming Comparison and a Study on DCCP & SCTP Protocols
 
Sania rtp
Sania rtpSania rtp
Sania rtp
 

Viewers also liked

XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
The Linux Foundation
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19NYversity
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10NYversity
 
Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1NYversity
 
Programming methodology lecture09
Programming methodology lecture09Programming methodology lecture09
Programming methodology lecture09NYversity
 
Machine learning (12)
Machine learning (12)Machine learning (12)
Machine learning (12)NYversity
 
Computer network (7)
Computer network (7)Computer network (7)
Computer network (7)
NYversity
 
Programming methodology lecture05
Programming methodology lecture05Programming methodology lecture05
Programming methodology lecture05NYversity
 
Programming methodology lecture02
Programming methodology lecture02Programming methodology lecture02
Programming methodology lecture02NYversity
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25NYversity
 
Computer network (1)
Computer network (1)Computer network (1)
Computer network (1)
NYversity
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16NYversity
 
Principles of programming languages
Principles of programming languagesPrinciples of programming languages
Principles of programming languagesNYversity
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13NYversity
 
Programming methodology lecture01
Programming methodology lecture01Programming methodology lecture01
Programming methodology lecture01NYversity
 
Lect9 (1)
Lect9 (1)Lect9 (1)
Lect9 (1)
Abdo sayed
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
Ram Dutt Shukla
 

Viewers also liked (17)

XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10
 
Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
 
Programming methodology lecture09
Programming methodology lecture09Programming methodology lecture09
Programming methodology lecture09
 
Machine learning (12)
Machine learning (12)Machine learning (12)
Machine learning (12)
 
Computer network (7)
Computer network (7)Computer network (7)
Computer network (7)
 
Programming methodology lecture05
Programming methodology lecture05Programming methodology lecture05
Programming methodology lecture05
 
Programming methodology lecture02
Programming methodology lecture02Programming methodology lecture02
Programming methodology lecture02
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25
 
Computer network (1)
Computer network (1)Computer network (1)
Computer network (1)
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16
 
Principles of programming languages
Principles of programming languagesPrinciples of programming languages
Principles of programming languages
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13
 
Programming methodology lecture01
Programming methodology lecture01Programming methodology lecture01
Programming methodology lecture01
 
Lect9 (1)
Lect9 (1)Lect9 (1)
Lect9 (1)
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
 

Similar to Computer network (16)

Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDPsangusajjan
 
Computer network
Computer networkComputer network
Computer network
Gaurav Rawat
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IP
vijai s
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
Ahmed Kamel Taha
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)
NYversity
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
Maulik Patel
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
Kazuho Oku
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
Peter R. Egli
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6
Olivier Bonaventure
 
transport protocols
transport protocolstransport protocols
transport protocols
keerthigakeerthigaD
 
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sampleVoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
Faisal Khan
 
IPAddressing .pptx
IPAddressing .pptxIPAddressing .pptx
IPAddressing .pptx
karthikvcyber
 
Tcpip
TcpipTcpip
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slides
adam_merritt
 
Computer network
Computer networkComputer network
Computer network
Gaurav Rawat
 
IRJET- Modeling a New Startup Algorithm for TCP New Reno
IRJET- Modeling a New Startup Algorithm for TCP New RenoIRJET- Modeling a New Startup Algorithm for TCP New Reno
IRJET- Modeling a New Startup Algorithm for TCP New Reno
IRJET Journal
 
Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion control
Abdo sayed
 
Tcp congestion control (1)
Tcp congestion control (1)Tcp congestion control (1)
Tcp congestion control (1)
Abdo sayed
 
features of tcp important for the web
features of tcp  important for the webfeatures of tcp  important for the web
features of tcp important for the web
rinnocente
 
Packet Card Knowledge Transferfinal
Packet Card Knowledge TransferfinalPacket Card Knowledge Transferfinal
Packet Card Knowledge Transferfinal
Abdel-Fattah M. Hmoud
 

Similar to Computer network (16) (20)

Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDP
 
Computer network
Computer networkComputer network
Computer network
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IP
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
Programming TCP for responsiveness
Programming TCP for responsivenessProgramming TCP for responsiveness
Programming TCP for responsiveness
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
 
Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6Part 9 : Congestion control and IPv6
Part 9 : Congestion control and IPv6
 
transport protocols
transport protocolstransport protocols
transport protocols
 
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sampleVoiceBootcamp Ccnp collaboration lab guide v1.0 sample
VoiceBootcamp Ccnp collaboration lab guide v1.0 sample
 
IPAddressing .pptx
IPAddressing .pptxIPAddressing .pptx
IPAddressing .pptx
 
Tcpip
TcpipTcpip
Tcpip
 
Training Day Slides
Training Day SlidesTraining Day Slides
Training Day Slides
 
Computer network
Computer networkComputer network
Computer network
 
IRJET- Modeling a New Startup Algorithm for TCP New Reno
IRJET- Modeling a New Startup Algorithm for TCP New RenoIRJET- Modeling a New Startup Algorithm for TCP New Reno
IRJET- Modeling a New Startup Algorithm for TCP New Reno
 
Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion control
 
Tcp congestion control (1)
Tcp congestion control (1)Tcp congestion control (1)
Tcp congestion control (1)
 
features of tcp important for the web
features of tcp  important for the webfeatures of tcp  important for the web
features of tcp important for the web
 
Packet Card Knowledge Transferfinal
Packet Card Knowledge TransferfinalPacket Card Knowledge Transferfinal
Packet Card Knowledge Transferfinal
 

More from NYversity

3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-distNYversity
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28NYversity
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27NYversity
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26NYversity
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24NYversity
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23NYversity
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22NYversity
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20NYversity
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18NYversity
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17NYversity
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15NYversity
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14NYversity
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12NYversity
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11NYversity
 
Programming methodology lecture08
Programming methodology lecture08Programming methodology lecture08
Programming methodology lecture08NYversity
 
Programming methodology lecture07
Programming methodology lecture07Programming methodology lecture07
Programming methodology lecture07NYversity
 
Programming methodology lecture06
Programming methodology lecture06Programming methodology lecture06
Programming methodology lecture06NYversity
 
Programming methodology lecture04
Programming methodology lecture04Programming methodology lecture04
Programming methodology lecture04NYversity
 
Programming methodology lecture03
Programming methodology lecture03Programming methodology lecture03
Programming methodology lecture03NYversity
 
Design patterns
Design patternsDesign patterns
Design patternsNYversity
 

More from NYversity (20)

3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-dist
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11
 
Programming methodology lecture08
Programming methodology lecture08Programming methodology lecture08
Programming methodology lecture08
 
Programming methodology lecture07
Programming methodology lecture07Programming methodology lecture07
Programming methodology lecture07
 
Programming methodology lecture06
Programming methodology lecture06Programming methodology lecture06
Programming methodology lecture06
 
Programming methodology lecture04
Programming methodology lecture04Programming methodology lecture04
Programming methodology lecture04
 
Programming methodology lecture03
Programming methodology lecture03Programming methodology lecture03
Programming methodology lecture03
 
Design patterns
Design patternsDesign patterns
Design patterns
 

Recently uploaded

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 

Computer network (16)

  • 1. Lecture 10: TCP Friendliness, DCCP, NATs, and STUN
  • 3. Congestion Control TCP dynamically adapts its rate in response to congestion AIMD causes flows to converge to fair goodput But how do losses (e.g., bit errors) affect goodput? What about UDP?
  • 4. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B Efficient A+B=C overload underload t1 t2 t3 t4 t5 t6
  • 5. Responding to Loss Set threshold to cwnd 2 On timeout - Set cwnd to 1 - Causes TCP to enter slow start On triple duplicate ACK (Reno) - Set cwnd to cwnd 2 - Retransmit missing segment - Causes TCP to stay in congestion avoidance
  • 6. Analyzing TCP Simply Assume all segments are MSS long Assume a packet loss rate p Assume a constant RTT Assume p is small (no timeouts)
  • 7. Analysis Window size W cuts to W 2 after a loss Grows to W after W 2 RTTs Goodput = 3 4 W MTU 1 RTT
  • 8. Window Size p = 1 (W 2 +(W 2 +1)+:::+W) p 1 3 8W2 W q 8 3p Goodput = 3 4 q 8 3p MTU 1 RTT Goodput = 1:22MTU p p RTT Constant factor changes based on delayed acks, etc.
  • 9. TCP Friendliness Don’t want other protocols to disrupt TCP UDP happily shuts down TCP flows “TCP friendliness:” obeying TCP congestion control as per prior goodput equation - Does not imply acting like TCP - E.g., does not require abrupt window changes
  • 10.
  • 11. ledbat WG “The LEDBAT WG is chartered to standardize a congestion control mechanism that should saturate the bottleneck, maintain low delay, and yield to standard TCP.” TCP-friendliness is insufficient for modern P2P applications - Flow fairness, not application fairness - TCP fills queues Elastic workloads vs. inelastic workloads
  • 12. DCCP
  • 13. DCCP Datagram Congestion Control Protocol (DCCP) provides congestion control for unreliable datagrams (RFC 4340) Connection-oriented protocol - Request-response-ack establishment - Close-reset or CloseReq-Close-reset teardown Counts packets, not bytes
  • 15. Sequence Numbers Every DCCP packet uses a new sequence number - Data - Acknowledgements - Control traffic Acknowledgements are for last packet received - Not cumulative acknowledgements - Does not succinctly describe connection history - Options can give packet vectors
  • 16. Synchronization DCCP uses sequence number windows to protect from attacks Large bursts of losses cause packets to fall past windows Need to resynchronize
  • 20. Congestion Control Defines Congestion Control IDs (CCIDs) Negotiated with change/confirm L/R options Each half-connection can have different congestion control CCID 2: TCP congestion control (AIMD) (RFC 4941) CCID 3: TCP-friendly congestion control (RFC 4942)
  • 21. CCID 2 Uses TCP congestion control - Maintains a cwnd, slow-start, etc. Adds congestion control to acks - Sender specifies an AckRatio, R - Ratio of data to ack packets (TCP with delayed ACKs is 2) - On detecting ack losses, double R - After cwnd R2R lossless congestion windows, decrement R
  • 22. CCID 3 Uses TCP-friendly congestion control Uses a sending rate, rather than a congestion window Receiver sends feedback once per RTT, reporting loss rate If sender hears no feedback, halves sending rate Security issue with loss rate reporting: report loss intervals, rather than just a loss rate, verifiable with ECN nonces
  • 23. DCCP Today Numerous implementations IETF Standards Track Well suited to VoIP, Internet Gaming, etc. Sees very little use
  • 26. NAT Network Address Translator NAT (128.34.22.8) Client A (10.0.0.101) NAT (76.18.117.20) Client B (10.1.1.9) Session A-S 10.0.0.101:1234 18.181.0.31:22 Session B-S 10.1.1.9:5411 18.181.0.31:22 Server (18.181.0.31) Session B-S 76.18.117.20:10001 18.181.0.31:22 Session A-S 128.34.22.8:6101 18.181.0.31:22
  • 27. Motivations and Complications There are only 232 IP addresses Firewalls for security Breaks end-to-end (node does not know its external IP) Node might not even know if it’s behind a NAT NAT needs to be able to dynamically assign mappings
  • 28. How a NAT Works Maps between global and local (IP,port) pairs Requires knowledge of transport packet format UDP datagram, TCP SYN - Can shut down TCP mapping on FIN+ACK - UDP requires timeouts ( 2 minutes, unless IANA says otherwise) RFC 4787/BCP 127 defines recommended behaviors
  • 29. NAT Example, Step 1 NAT (128.34.22.8) Client A (10.1.1.18) Server (18.181.0.31) Client B (10.1.1.9)
  • 30. NAT Example, Step 2 NAT (128.34.22.8) Client A (10.1.1.18) Server (18.181.0.31) 10.1.1.18 18.181.0.31 4512 80 Client B (10.1.1.9) Client A tries to open a connection to Server port 80 from port 4512
  • 31. NAT Example, Step 3 NAT (128.34.22.8) Client A (10.1.1.18) Server (18.181.0.31) Client B (10.1.1.9) NAT rewrites the source address and port so it seems it is the source 128.34.22.8 18.181.0.31 6641 80 10.1.1.18 18.181.0.31 4512 80
  • 32. NAT Example, Step 4 NAT (128.34.22.8) Client A (10.1.1.18) Server (18.181.0.31) Client B (10.1.1.9) NAT also creates a mapping so it can transform future packets correctly 18.181.0.31 10.1.1.18 4512 80 128.34.22.8 6641
  • 33. NAT Example, Step 5 NAT (128.34.22.8) Client A (10.1.1.18) Server (18.181.0.31) 18.181.0.31 Client B (10.1.1.9) Server responds to SYN with SYN+ACK and NAT rewrites it 18.181.0.31 128.34.22.8 80 6641 10.1.1.18 80 4512 18.181.0.31 10.1.1.18 4512 80 128.34.22.8 6641
  • 34. NAT Example, Step 6 NAT (128.34.22.8) Client A (10.1.1.18) Server (18.181.0.31) 18.181.0.31 Client B (10.1.1.9) Client B can also open a connection, and the NAT creates a mapping for it too 18.181.0.31 128.34.22.8 80 4050 10.1.1.19 80 9967 18.181.0.31 10.1.1.19 9967 80 128.34.22.8 4050
  • 35. NAT Example, Step 7 Client A (10.1.1.18) Server (18.181.0.31) In the case of TCP, NAT can discard the mapping on close or RST RST RST NAT (128.34.22.8) 18.181.0.31 Client B (10.1.1.9) 18.181.0.31 128.34.22.8 80 6641 10.1.1.18 80 4512 18.181.0.31 10.1.1.18 4512 80 128.34.22.8 6641
  • 36. Types of NAT (RFC 3849) Full Cone: no ingress filter (single local-external mapping) Restricted Cone: ingress filter on address Port Restricted: ingress filter on address/port Symmetric: different mappings for different external destinations Teminology is imperfect (static port mappings, etc.)
  • 37. NAT Problems Incoming TCP connections E.g., Skype clients super nodes bootstrap call super node relay
  • 38. TCP Through NATs Server socket doesn’t initiate traffic: NAT can’t set up mapping Rendezvous servers (as in Skype) Connection reversal through rendezvous if only one is behind a NAT (rendezvous server asks un-NAT node to open a port so NAT node can connect)
  • 40. More NAT Problems Port mapping: 0-1023 should map to 0-1023 Port parity: even port!even port, odd port!odd port (RFC 3550: RTP uses even, RTCP uses odd)) Hairpinning: packet from inside NAT can send packets to external (NAT) address and have portmap work
  • 41. RFC 4787 and Hairpinning “NAT UDP Unicast Requirements” - F. Audet and C. Jennings (guest lecture last year) More formally, a NAT that supports hairpinning forwards packets originating from an internal address, X1:x1, destined for an external address X2':x2' that has an active mapping to an internal address X2:x2, back to that internal address, X2:x2. Note that typically X1' is the same as X2'. Furthermore, the NAT may present the hairpinned packet with either an internal (X1:x1) or an external (X1':x1') source IP address and port. Therefore, the hairpinning NAT behavior can be either External source IP address and port or Internal source IP address and port. Internal source IP address and port may cause problems by confusing implementations that expect an external IP address and port.
  • 42. Example confusion Two nodes (A, B) share a switch behind a NAT A sends TCP SYN to an external address for B B responds with SYN+ACK What can happen if NAT did not rewrite A’s SYN to have an external address and port? Will B’s packet traverse the NAT?
  • 43. Simple Traversal of UDP through NATs
  • 44. STUN (RFC 3849) “Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)” Enables a node to - Determine if it is behind a NAT, and if so, what kind - Obtain a public IP address/port pair Client-server protocol, requires no changes to NATs STUN server coordinates
  • 45. STUN Binding Requests Node sends BR to STUN server STUN sends a response that has the address and port it sees - If different than node’s local address and port, it’s behind a NAT Node can probe to see what kind of NAT - Ask STUN server to respond from different address: no response, address restricted; different response, symmetric - Ask STUN server to respond from different port: no response, port restricted When does STUN not work?
  • 46. NAT Hole-Punching STUN doesn’t work when - A or B are behind symmetric NAT - A and B are behind same NAT without hairpinning - What about restricted cone, port-restricted NATs? Parallel approaches - A and B report their local IP address to server Sx - Server tells the other the address/port pair (L;G) - A tries to send UDP packets to (LB;GB) using LA - B tries to send UDP packets to (LA;GA) using LB
  • 47. NAT Hole-Punching Example Client A (10.0.0.101) NAT (76.18.117.20) Client B (10.1.1.9) Server (18.181.0.31) NAT (128.34.22.8)
  • 48. NAT Hole-Punching Example 1. Request connection to B Client A (10.0.0.101) NAT (76.18.117.20) Client B (10.1.1.9) Server (18.181.0.31) NAT (128.34.22.8)
  • 49. NAT Hole-Punching Example Client A (10.0.0.101) Server (18.181.0.31) 2a. S sends LB and GB to A 2b. S sends LA and GA to B NAT (76.18.117.20) Client B (10.1.1.9) NAT (128.34.22.8)
  • 50. NAT Hole-Punching Example Client A (10.0.0.101) Server (18.181.0.31) 3a. A sends to LB and GB 3b. B sends to LA and GA NAT (76.18.117.20) Client B (10.1.1.9) NAT (128.34.22.8)
  • 51. NAT Hole-Punching Example Client A (10.0.0.101) Client B (10.1.1.9) Server (18.181.0.31) NAT (76.18.117.20) NAT (128.34.22.8) 4. Session A-B established
  • 52. Multiple NAT Layers Common for consumer Internet: ISP has internal NAT, end user places another NAT Requires hairpinning at ISP NAT Client A (10.0.0.101) UserNAT (192.168.3.7) Client B (10.1.1.9) ISP NAT (18.181.0.31) User NAT (192.168.4.1) Internet ISP Network
  • 53. The New Hourglass Layers 5-7 TCP UDP ICMP IP Layers 1-2
  • 56.
  • 57. Midterm Grades A: 80-100 B: 60-79 C: 50-59 D: 40-59 F: 40 Don’t forget two-thirds rule on final grade, final exam can trump midterm
  • 58. Travel:W-F Guest lectureWednesday: David Mazi´eres - Topic: IPv6, multicast, anycast Phil’s office hours: Today 2:05-3