Presentation is loading. Please wait.

Presentation is loading. Please wait.

Outline IP Datagram (IPv4) NAT

Similar presentations


Presentation on theme: "Outline IP Datagram (IPv4) NAT"— Presentation transcript:

1 Outline IP Datagram (IPv4) NAT
Connection less and connection oriented service Routing protocol Distance vector routing Link state routing

2 Virtual Circuit (VC) Networks like ATM or Frame Relay networks implement VC. A VC consists of following three components A Path – A series of links and routers between source and destination VC Numbers – An ID number for each link along the path. Entries in forwarding table of EACH router along the path. Note: For each link, interface no. is different from VC no. Also, one interface can be associated with many VCs. Every packet carries a VC number in its header. Each intervening router replaces the VC number of each traversed packet with a new VC number. The new VC number was obtained from the forwarding table, example:

3 Forwarding Table in VC Forwarding table in northwest router:
12 22 32 1 2 3 VC number interface number Forwarding table in northwest router: Incoming interface Incoming VC # Outgoing interface Outgoing VC # … … … … Routers maintain connection state information!

4 Phases in Virtual Circuit:
VC setup – Determining the series of links and switches through which all packets of the VC will travel. Data transfer - Once the VC has been established, data can begin to flow along the VC. Virtual circuit teardown - inform the end system about call termination, and update the tables in each of the packet switches on the path to indicate that the VC no longer exists. Note: In TL connection set-up, the routers within the network are unaware of the connection. Whereas in NL, routers are involved in VC set-up and aware of all the VCs passing through it.

5 Datagram Networks Put destination IP address and send it to network.
Internet is Datagram Network. NO call setup at network layer ROUTERS: NO state information about end-to-end connections no network-level concept of “connection” Packets forwarded using destination host address packets between same source-destination pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data

6 Datagram Networks Each router uses the packet’s destination address to forward the packet. Each router has a forwarding table that maps destination address to the link interfaces. The router matches a prefix of the packet’s destination address with the entries in the table; if there is a match, the router forwards the packet to a link associated with the match. Uses Longest Prefix Matching Rule. Example Forwarding Table for Datagram Network: PREFIX MATCH LINK INTERFACE _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 _ _ _ _ _ _ _ _ _ _ 2 Otherwise 3

7 Recap - Private Addresses
Class A: (Net id) and no of Blocks is 1 Class B: and no of Blocks 16 Class C: and no of Blocks 256

8 NAT – Network Address Translation
NAT enabled router acts as intermediate between a public and private network. This private network would be a realm with private addresses. i.e. a network whose addresses only have meaning to devices within that network. NAT router behaves to outside world as a single device with a single IP address (for the whole private n/w).

9 NAT – Network Address Translation
Note: /24 addresses can have meaning only within the given home-network.

10 Refer figure, all the traffic leaving private n/w has the same source IP address as 145.12.131.7
QUESTION: Where the home network computers and the NAT router get their addresses from? ANSWER: Router gets its address from ISP’s DHCP server. Similarly, router runs DHCP server to provide addresses to computers within the NAT-DHCP-Router –Controlled home network. NAT Table – includes IP address as well as PORT NUMBER in the table entries. One port each for every process running on any host in the home-network. Port number is 16 bits long. Thus, possible feasible count is 60,000+ port numbers/entries in a NAT Table at a time. Refer figure, port no. (3855) for given private IP address is generated by HOST itself, whereas port no. (6282) for public counterpart of given IP address is generated by NAT router.

11 Internet Control Message Protocol - ICMP
Used by hosts and routers to communicate network layer information. TTL Trace route Ping Error control Example: “Destination network unreachable” message generates at a router if it is unable to find a path to the host specified in your Telnet/FTP/HTTP. ICMP messages are carried inside IP datagrams as IP payload, just same as TCP or UDP segment. Content fields of ICMP message; Type Code Header Checksum

12 Internet Control Message Protocol - ICMP
ICMP Type Code Description Echo reply (to ping) 3 2 Destination protocol unreachable 6 Destination network unknown 8 Echo request 11 IPv4 –TTL field expired Sample ICMP message type. Refer text book for more messages

13 Internet Control Message Protocol - ICMP
Examlpes: A ping program sends an ICMP type 8 code 0 message to the specified host. The destination host, seeing the echo request, sends back a type 0 code 0 ICMP echo reply.

14 Performance metric: Routing Number of hops Measured delay
Mean queue length Average traffic Bandwidth Transmission delay

15 Routing Terminology Default Router – To whom the host is attached directly. Source Router – Default router of the source host. Destination Router – Default router of destination host. Each connecting link has a certain cost. GOOD path = Least cost path Network is represented as graph G=(N,E). Set of N nodes and collection of E edges/links. If the cost of all the links in the network is same, then Least-Cost path = Shortest path (A path with smallest number of links bet source and destination pair)

16 Routing protocols: classification
Static routes Computed off-line based on a fixed topology, traffic, performance metric Not change, unless there is a major network overhaul Adaptive routing Routes adapt to changes in topology, traffic On-line based on current measurements Based on complete or partial knowledge Distributed computation vs. centralized computation Other algorithms Flooding Broadcasting Static Adaptive Centralized / Global (based on all info) OR Link State Routing Example: Dijkstra’s Algorithm, (OSPF) Decentralized (on incomplete info) Distance-Vector Routing Routing algorithms others

17 Routing module and routing table
Figure 6-7 Routing module and routing table

18 Link State Routing: Dijkstra’s (Least Cost Path) Algorithm
Dijkstra’s algorithm Network 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 forwarding table for that node Iterative: after k iterations, know least cost path to k dest.’s Notation: c(x,y): link cost from node x to y; = ∞ if not direct neighbors D(v): current value of cost of path from source to dest. v p(v): predecessor node of v, along the current least-cost path from source to v N‘ : set of nodes whose least-cost path is definitively known

19 Assumption: Source is u. Destination is v.
Dijsktra’s Algorithm Assumption: Source is u. Destination is v. D(v) = min( D(v), D(w) + c(w,v) )

20 Dijsktra’s Algorithm - Least-Cost Path Routing
Step 1 2 3 4 5 N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u D(w),p(w) 5,u 4,x 3,y D(x),p(x) 1,u D(y),p(y) 2,x D(z),p(z) 4,y u y x w v z 2 1 3 5

21 Dijsktra’s Algorithm - Least-Cost / Shortest Path Routing
Resulting shortest-path (when cost of each link is same) tree from u: Resulting forwarding table in u: v x y w z (u,v) (u,x) destination link u y x w v z Note: The number of times the loop given in the algorithm is executed is equal to the number of nodes in the network

22 Adaptive routing Centralized / Global/ Link-state routing – Dijkstra’s Algo OSPF Distance-vector routing BGP Others Hierarchical routing

23 Distance Vector Algorithm
Distance Vector Routing Algorithm has got following properties: Distributed – Each node receives some information from one or more of its directly attached neighbours. Iterative – This process continues on until no more information is exchanged between neighbours. Self-terminating Asynchronous

24 Distance Vector Algorithm - Bellman-Ford Equation
DV Algo is based on Bellman-Ford Equation dx(y) = cost of least-cost path from x to y c(x,v) =cost to each neighbor v, from x Then dx(y) = min {c(x,v) + dv(y) } where min is taken over all neighbors of x; and v belongs to the set of neighbors of x. This solution to BF equation provides the entries in node x’s forwarding table

25 Distance Vector Algorithm - Concept
Basic idea: Each node periodically sends its own distance vector estimate to all neighbors v. When a node x receives new DV estimate from its neighbor, it update its own DV using B-F equation: To compute the cost from X to Y: Dx(y) = minv{c(x,v) + Dv(y)} for each node y ∊ N

26

27

28 Distance Vector: Link Cost Changes
x z 1 4 50 y Link cost changes: node detects local link cost change updates routing info, recalculates distance vector if DV changes, notify neighbors At time t0, y detects the link-cost change, updates its DV, and informs its neighbors. 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. “good news travels fast” Time

29 Bellman-Ford Example To compute the path from u to z. Given data:
Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 u y x w v z 2 1 3 5 According to BF equation: 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 Node that achieves minimum value is the next hop in shortest path ➜ forwarding table

30 Comparison of LS and DV algorithms
1. Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only 2. Speed of Convergence LS: O(n2) algorithm requires O(nE) msgs DV: convergence time varies may be routing loops count-to-infinity problem 3. Robustness LS: node can advertise incorrect link cost attached to it each node computes only its own table => more robust DV: DV node can advertise incorrect path cost each node’s table used by others error propagate thru network

31 Comparison of LS and DV algorithms - Summary
Distance Vector Routing: Tell neighbors about distance of all the destination Node’s computation depends on neighbors Each router maintains distance vector, (dist , cost) tuple per destination Periodically send copy of distance vector to all neighbors Link State Routing : Tell about distance to each neighbor to all routers Each router computes its best paths

32 Route Loops Count to infinity
Split horizon: by prohibiting a router from advertising a route back onto the interface from which it was learned. Route Poisoning: Making a route unreachable

33 Hierarchical Routing Scale Administrative Autonomy
Autonomous Systems (group of routers under the same administrative control (e.g., same ISP or are of same company network). all run the same routing algorithm (LS or DV) and have information about each other) Gateway Routers

34

35 Routing Inter-AS routing protocol (Exterior gateway routing protocol)
BGP (Border Gateway Protocol) intra-AS routing protocol (interior gateway routing protocol) RIP(DV), OSPF(LS)

36 Broadcast Routing Deliver packets from srce to all other nodes
Source duplication is inefficient: R1 R2 R3 R4 source duplication in-network duplication duplicate creation/transmission Source duplication: how does source determine recipient addresses

37 In-network duplication
Uncontrolled Flooding: when node receives brdcst pckt, sends copy to all neighbors Problems: cycles & broadcast storm Controlled flooding: node only brdcsts pkt if it hasn’t brdcst same packet before Node keeps track of pckt ids already brdcsted Or reverse path forwarding (RPF): only forward pckt if it arrived on shortest path between node and source Spanning tree No redundant packets received by any node

38 (a) Broadcast initiated at A (b) Broadcast initiated at D
Spanning Tree First construct a spanning tree Nodes forward copies only along spanning tree A B G D E c F (a) Broadcast initiated at A (b) Broadcast initiated at D

39 Spanning Tree: Creation
Center node Each node sends unicast join message to center node Message forwarded until it arrives at a node already belonging to spanning tree A A 3 B B c c 4 2 D D F E F E 1 5 G G Stepwise construction of spanning tree (E) (b) Constructed spanning tree

40 Multicast Routing Goal: find a tree (or trees) connecting routers having local mcast group members tree: not all paths between routers used source-based: different tree from each sender to rcvrs shared-tree: same tree used by all group members Notes: 3.3 Network Layer: Multicast Routing Algorithms

41 Approaches for building mcast trees
source-based tree: one tree per source shortest path trees reverse path forwarding group-shared tree: group uses one tree minimal spanning (Steiner) center-based trees Notes: 3.3 Network Layer: Multicast Routing Algorithms

42 Shortest Path Tree mcast forwarding tree: tree of shortest path routes from source to all receivers Dijkstra’s algorithm S: source Notes: 3.3 Network Layer: Multicast Routing Algorithms R1 2 R4 1 R2 5 3 4 R5 6 R3 R6 R7

43 Center-based trees single delivery tree shared by all
one router identified as “center” of tree to join: edge router sends unicast join-msg addressed to center router join-msg “processed” by intermediate routers and forwarded towards center join-msg either hits existing tree branch for this center, or arrives at center path taken by join-msg becomes new branch of tree for this router Notes: 1. It’s always nice to see a PhD dissertation with impact. The earliest discussion of center-based trees for multicast appears to be D. Wall, “Mechanisms for Broadcast and Selective Broadcast,” PhD dissertation, Stanford U., June 1980. 3.3 Network Layer: Multicast Routing Algorithms

44 Center-based trees: an example
Suppose R6 chosen as center: R1 R4 3 Notes: 3.3 Network Layer: Multicast Routing Algorithms R2 2 R5 R3 1 R6 R7


Download ppt "Outline IP Datagram (IPv4) NAT"

Similar presentations


Ads by Google