Download presentation
Presentation is loading. Please wait.
Published byΣουσάννα Βαρουξής Modified over 6 years ago
1
NAT traversal problem client want to connect to server with address server address local to LAN (client can’t use it as destination addr) only one externally visible NATted address: solution 1: statically configure NAT to forward incoming connection requests at given port to server e.g., ( , port 2500) always forwarded to port 25000 Client ? NAT router Network Layer
2
Solution #1 Example: Cisco wireless router
Network Layer
3
NAT traversal problem solution 2: Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATted host to: learn public IP address ( ) Drill a “hole” in NAT Add a port mappings on NAT Require both host and NAT to be UPnP compatible automate static NAT port map configuration IGD NAT router Network Layer
4
NAT traversal problem solution 3: relaying (used in Skype)
NATed server establishes connection to relay External client connects to relay relay bridges packets between to connections 2. connection to relay initiated by client 1. connection to relay initiated by NATted host 3. relaying established Client NAT router Network Layer
5
IP Fragmentation and Reassembly
ID =x offset =0 fragflag length =4000 =1 =1500 =185 =370 =1040 One large datagram becomes several smaller datagrams Example 4000 byte datagram MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 Network Layer
6
DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address from network server when it joins network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on” Support for mobile users who want to join network (more shortly) DHCP overview: host broadcasts “DHCP discover” msg DHCP server responds with “DHCP offer” msg host requests IP address: “DHCP request” msg DHCP server sends address: “DHCP ack” msg Network Layer
7
DHCP client-server scenario
server B arriving DHCP client needs address in this network E Network Layer
8
DHCP client-server scenario
DHCP server: arriving client DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs time DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs Network Layer
9
Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing Network Layer
10
ICMP: Internet Control Message Protocol
used by hosts & routers to communicate network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer “above” IP: ICMP msgs carried in IP datagrams Not built on TCP! ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description echo reply (ping) dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header Network Layer
11
Traceroute and ICMP Source sends series of UDP segments to dest
First has TTL =1 Second has TTL=2, etc. Unlikely port number When nth datagram arrives to nth router: Router discards datagram And sends to source an ICMP message (type 11, code 0) Message includes name of router& IP address When ICMP message arrives, source calculates RTT Traceroute does this 3 times Stopping criterion UDP segment eventually arrives at destination host Destination returns ICMP “host unreachable” packet (type 3, code 3) When source gets this ICMP, stops. Ethereal example Network Layer
12
Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing Network Layer
13
IPv6 Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation: header format helps speed processing/forwarding header changes to facilitate QoS Checksum: removed entirely to reduce processing time at each hop IPv6 datagram format: fixed-length 40 byte header no fragmentation allowed Very slow take off IPv4 still has space (CIDR, DHCP, NAT) Too trouble to upgrade Network Layer
14
IPv6 Header (Cont) Priority: identify priority among datagrams in flow
Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data Network Layer
15
Transition From IPv4 To IPv6
Not all routers can be upgraded simultaneous no “flag days” How will the network operate with mixed IPv4 and IPv6 routers? Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Network Layer
16
Tunneling A B E F Logical view: Physical view: A B E F tunnel IPv6
Network Layer
17
Tunneling B E A B E F Logical view: A C D F Physical view: Src:B
IPv6 IPv6 IPv6 IPv6 A B C D E F Physical view: IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F data A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 Network Layer
18
IPv6 Tunneling vs. IPv4 NAT
Similarity: Both have one IPv4 public IP address, and many computers behind it Conduct translation/capculing on that special edge router Difference: Hosts behind NAT are un-addressable Cannot communicate with each other Hosts behind Tunneling are addressable Can communicate with each other directly Network Layer
19
Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing Network Layer
20
Routing Algorithm classification
Global or decentralized information? Global: all routers have complete topology, link cost info “link state” algorithms Decentralized: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors “distance vector” algorithms Static or dynamic? Static: routes change slowly over time Dynamic: routes change more quickly periodic update in response to link cost changes Network Layer
21
Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing Network Layer
22
A Link-State Routing Algorithm
Dijkstra’s algorithm net topology, link costs known to all nodes accomplished via “link state broadcast” all nodes have same info computes least cost paths from one node (“source”) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k destinations Idea: at each iteration increase spanning tree by the node that has least cost path to the source 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1 Network Layer
23
A Link-State Routing Algorithm
Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of cost of path from source to dest. V p(v): predecessor node along path from source to v, that is next v N: set of nodes already in spanning tree (least cost path known) Examples: c(B,C) = 3 D(E) = 2 p(B) = A N = { A, B, D, E } 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1 Network Layer
24
Dijsktra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v
if v adjacent to A then D(v) = c(A,v) else D(v) = infinity 7 8 Loop find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: D(v) = min( D(v), D(w) + c(w,v) ) /* new cost to v is either old cost to v or known shortest path cost to w plus direct link cost from w to v */ 15 until all nodes in N Network Layer
25
Dijkstra’s algorithm: example
Step 1 2 3 4 5 N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) A 2,A ,A ,A infinity,- infinity,- AD 2,A ,D ,A ,D infinity,- ADE 2,A ,E ,A ,D ,E ADEB 2,A ,E ,A ,D ,E ADEBC 2,A ,E ,A ,D ,E ADEBCF 2,A ,E ,A ,D ,E 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1 Network Layer
26
Spanning tree gives routing table
Step N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) ADEBCF 2,A ,E ,A ,D ,E Result from Dijkstra’s algorithm B C D E F Outgoing link to use, cost B,2 D,3 D,1 D,2 D,4 Routing table: 5 3 B C 5 2 A 2 1 F 3 1 2 D E 1 destination Network Layer
27
Dijkstra’s algorithm discussion
Oscillations are possible dynamic link cost e.g., link cost = amount of carried traffic by link c(i,j) != c(j,i) Example: A A A 1 A 1+e 2+e 2+e 2+e D B D B D B D B 1+e 1 1+e 1 e 1 C 1+e e C C C 1 1 e … recompute routing … recompute … recompute initially Network Layer
28
Chapter 4: Network Layer
4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing Network Layer
29
Distance Vector Algorithm (1)
Bellman-Ford Equation (dynamic programming) Define dx(y) := cost of least-cost path from x to y Then dx(y) = minv {c(x,v) + dv(y) } where min is taken over all neighbors of x Network Layer
30
Bellman-Ford example Suppose we know that
dv(z) = 5, dx(z) = 3, dw(z) = 3 u y x w v z 2 1 3 5 B-F equation says: du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 How about du(y)? Network Layer
31
Distance Vector Algorithm (3)
Dx(y) = estimate of least cost from x to y Distance vector: Dx = [Dx(y): y є N ] Node x knows cost to each neighbor v: c(x,v) Node x maintains Dx = [Dx(y): y є N ] Node x also maintains its neighbors’ distance vectors For each neighbor v, x maintains Dv = [Dv(y): y є N ] Network Layer
32
Distance vector algorithm (4)
Basic idea: Each node periodically sends its own distance vector estimate to neighbors When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N Under minor, natural conditions, the estimate Dx(y) converge the actual least cost dx(y) Network Layer
33
Distance Vector Algorithm (5)
Iterative, asynchronous: each local iteration caused by: local link cost change DV update message from neighbor Distributed: each node notifies neighbors only when its DV changes neighbors then notify their neighbors if necessary Each node: wait for (change in local link, cost of msg from neighbor) recompute estimates if DV to any dest has changed, notify neighbors Network Layer
34
z y x Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 node x table x y z x y z ∞ from cost to cost to x y z x 2 3 from y z node y table cost to x z 1 2 7 y x y z x ∞ ∞ ∞ y from z ∞ ∞ ∞ node z table cost to x y z x ∞ ∞ ∞ from y ∞ ∞ ∞ z 7 1 time Network Layer
35
z y x Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 node x table x y z x y z ∞ from cost to cost to cost to x y z x y z x x from y from y z z node y table cost to cost to cost to x z 1 2 7 y x y z x y z x y z x ∞ ∞ x ∞ x y from y from from y z z ∞ ∞ ∞ z node z table cost to cost to cost to x y z x y z x y z x x x ∞ ∞ ∞ from y from y from y ∞ ∞ ∞ z z z 7 1 time Network Layer
36
Distance Vector: link cost changes
node detects local link cost change updates routing info, recalculates distance vector if DV changes, notify neighbors x z 1 4 50 y At time t0, y detects the link-cost change, updates its DV, and informs its neighbors. “good news travels fast” At time t1, z receives the update from y and updates its table. It computes a new least cost to x and sends its neighbors its DV. At time t2, y receives z’s update and updates its distance table. y’s least costs do not change and hence y does not send any message to z. Network Layer
37
Distance Vector: link cost changes
good news travels fast bad news travels slow - “count to infinity” problem! 44 iterations before algorithm stabilizes: see textbook Poisoned reverse: If Z routes through Y to get to X : Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) will this completely solve count to infinity problem? x z 1 4 50 y 60 Network Layer
38
Comparison of LS and DV algorithms
Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n2) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes only its own table DV: DV node can advertise incorrect path cost each node’s table used by others error propagate thru network Network Layer
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.