Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 5565 Network Architecture and Protocols Godmar Back Lecture 14.

Similar presentations


Presentation on theme: "CS 5565 Network Architecture and Protocols Godmar Back Lecture 14."— Presentation transcript:

1 CS 5565 Network Architecture and Protocols Godmar Back Lecture 14

2 Announcements Project 2A due Apr 8 –Reminder: can be done as a team, can switch teams between projects, use forum if you’re looking for team members Midterm April 1 (no joke) –Will provide overview sheet and sample exams on Wednesday Required Reading: –DCCP by Koehler et al, SIGCOMM 2006 1/27/2016CS 5565 Spring 20092

3 Network Address Translation TCP Hole Punching & Simultaneous Open

4 1/27/2016CS 5565 Spring 20094 NAT: Network Address Translation 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7 local network (e.g., home network) 10.0.0/24 rest of Internet Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers

5 1/27/2016CS 5565 Spring 20095 NAT: Network Address Translation Motivation: local network uses just one IP address as far as outside word is concerned: –no need to be allocated range of addresses from ISP: - just one IP address is used for all devices –can change addresses of devices in local network without notifying outside world –can change ISP without changing addresses of devices in local network –devices inside local net not explicitly addressable, visible by outside world (a huge security plus).

6 1/27/2016CS 5565 Spring 20096 NAT: Network Address Translation Implementation: NAT router must: –outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)... remote clients/servers will respond using (NAT IP address, new port #) as destination addr. –remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair –incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

7 1/27/2016CS 5565 Spring 20097 NAT: Network Address Translation 10.0.0.1 10.0.0.2 10.0.0.3 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 10.0.0.4 138.76.29.7 1: host 10.0.0.1 sends datagram to 128.119.40, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 2 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: Reply arrives dest. address: 138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345

8 1/27/2016CS 5565 Spring 20098 NAT Disadvantages 16-bit port-number field: –Only 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: –routers should only process up to layer 3 –violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications –address shortage should instead be solved by IPv6 –really annoying if you time out on rlogin.cs.vt.edu

9 NAT Challenges Considering that most Internet hosts are behind NAT these days – how should applications be written to deal with that? No problem as long as server has public IP and client knows where to connect (HTTP, XMPP, SMTP, POP) What about P2P applications? –Could relay through server, but that would defeat purpose of P2P –Instead, a technique called “hole punching” is widely used (e.g., in Skype) –Discussed in [Ford/Srisuresh/Kegel 2005]Ford/Srisuresh/Kegel 2005 UDP hole punching is widely used, but TCP hole punching is possible as well 1/27/2016CS 5565 Spring 20099

10 NAT Relaying All traffic goes through S Source: [Ford/Srisuresh/K egel 2005]Ford/Srisuresh/K egel 2005 1/27/2016CS 5565 Spring 200910

11 1/27/2016CS 5565 Spring 200911 Aside: TCP Hole Punching External server S records & provides private & public IP both behind-NAT hosts must punch holes with outgoing SYN – allows TCP connection

12 1/27/2016CS 5565 Spring 200912 Simultaneous Open (cont’d) Vint Cerf, 1987: Not invented for hole punching in NAT – coincidental use Distributed systems with symmetric processes that automatically seek to link to each other (no master/slave relationship) would use the simul-OPEN style. It was designed into TCP for that purpose; I do not know, however, whether any actual applications have made use of this feature.

13 1/27/2016CS 5565 Spring 200913 Simultaneous Open (a) TCP connection establishment in the normal case. (b) Call collision – one connection is established (“client-client” connection)

14 1/27/2016CS 5565 Spring 200914 TCP Connection FSM The heavy solid line is the normal path for a client. The heavy dashed line is the normal path for a server. The light lines are unusual events. Each transition is labeled by the event causing it and the action resulting from it, separated by a slash.

15 1/27/2016CS 5565 Spring 200915 TCP Hole Punching Must bind multiple sockets to same port (SO_REUSEADDR) Manage to identify which scenario has occurred Must handle case where both clients are behind the same NAT!

16 Remote Procedure Calls

17 1/27/2016CS 5565 Spring 200917 RPC: Remote Procedure Call (Birrell/Nelson 1984) CallerCallee arguments results CallerClient Stub arguments results Transport Callee arguments results Server Stub request/reply msgs

18 1/27/2016CS 5565 Spring 200918 RPC – Client & Server Stubs

19 1/27/2016CS 5565 Spring 200919 codea0a1a2a3.lena3.buf proc example_procedure = code takes int32 a0 int16 a1 int16 a2 bytearray a3 returns int32 32bit code argument #0 32bit int argument #1 16bit int argument #2 16bit int argument #3 of type bytearray 32bit length field followed by a3.len bytes RPC Encoding

20 1/27/2016CS 5565 Spring 200920 Architecture of Distributed Simulator in Project 2 Simulator Node 0 Node 1 Node n-1 … Outbound TCP Stream Inbound TCP Stream Outbound Request Reply Inbound Request Reply


Download ppt "CS 5565 Network Architecture and Protocols Godmar Back Lecture 14."

Similar presentations


Ads by Google