CN 05 NAT IPv6

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Lecture

Computer Communications & Networks 05

Network Address Translation (NAT/NAPT)


&
Internet Protocol version 6 (IPv6)
Depletion of IPv4 Addresses [4]

RIR = Regional Internet Registry 3


NAT / NAPT
Globally Unique IP addresses are precious
Organizations can’t afford to purchase hundreds of
IP addresses for their LAN users
They often purchase small number of global IP
addresses, and operate their all LAN users with
them
Think! As a LAN user while connecting over
Internet, you never use global addresses
There are two schemes:
Network Address Translation (NAT)
Network Address & Port Translation (NAPT)

4
NAT / NAPT Box

Local network
Internet
with many hosts
NAT Box

5
Network Address Translation
Purchase a pool of global IP addresses
Assign local private addresses inside the LAN
LAN users will use local addresses for local
communication
When they wish to communicate globally, nodes
will attach their local address in the IP header
This packet will pass through the NAT box
NAT box will replace the local address with global
address without telling the local user
This is translation from local address to global
address
6
NAT: cont…
NAT box will maintain a table for all these
translations
When replies will arrive from the Internet,
NAT box will again translate the addresses,
but now from global (External) address to the local
(Internal) address

7
Example of NAT Box
SA=192.168.0.11
(local)
NAT Translation table
Private IP : Public IP Www.riphah.edu
192.168.0.11 : 202.113.29.124 26.25.25.10
Private port : Public port

SA=192.168.0.12
(local)

Internet
SA=202.113.29.124
(global)

SA=192.168.0.13
(local)

SA = Source
Address

9
Translation through NAT

10
Translation through NAT

11
Static vs. Dynamic NAT

Source: http://computer.howstuffworks.com/nat1.htm (05-11-2010) 12


NAPT
Network Address and Port Translation (NAPT)
Also called Overloading NAT
And also Port Address Translation (PAT)
Rather than purchasing a pool of addresses, let’s
put up with only single IP address
Same global address will be used for all LAN users
Uniqueness is maintained via port numbers
Very economical scheme

13
NAPT

Source: http://computer.howstuffworks.com/nat1.htm (05-11-2010) 14


Translation through NAPT
Internal Addresses External Addresses

Src = Source IP, dst = Destination IP


Sp = Source Port, dp = Destination
Port

Source: http://www.exfo.com/en/Library/WaveReview/WRArticle.aspx?Id=204 (08-11-


2010) 15
Sample NAPT Table Entries

NAT Table

Internal IP Internal Port External IP External Port

192.168.1.101 12050 181.13.45.10 4500

192.168.1.102 51002 181.13.45.10 4501

192.168.1.103 51002 181.13.45.10 4502

192.168.1.112 12563 181.13.45.10 4503

192.168.1.124 32145 181.13.45.10 4504

16
NAT / NAPT pros & cons
Advantages:
Low cost solution, Public IP address sharing
Saves the rapidly depleting global IP address space
Transparent to end users
Improved security
Easy LAN scalability
Disadvantages:
Client-oriented
solution
Hosting servers behind NAT is complex (port forwarding)
Incompatibility with certain network applications
Computational overhead
17
IP Address Evolution

(Classless Inter Domain


Routing)

18
Internet Protocol version 6 (IPv6)
IPv6 is the latest version of the IP
Developed by IETF to deal with anticipated problem
of IPv4 address exhaustion
It provides following:
Identification and location system for computers
Routes traffic across the Internet
IPv6 is intended to replace IPv4
IPv4 carries more than 85% of Internet traffic worldwide
Percentage of users using IPv6 is 15%

19
IPv6 Adoption

20
IPv6 Address Structure

21
IPv6 Header Format

22
Version (4) Priority (8) Flow label (20)

Payload length (16) Next header (8) Hop limit (8)

Source Address (128)

Destination Address (128)

Extension headers:
Routing header (43)
Hop by hop option (0)
Fragment header (44)
Authentication header (51)
Destination option (60)
Encapsulating Security Payload (50)
IPv6 Packet

23
IPv4 & IPv6 Interoperability
IPv4 and IPv6 are not designed to be interoperable
It complicates the process of transition to IPv6
Several IPv6 transition mechanisms have been
devised to permit communication between IPv4 and
IPv6 hosts
Dual IP Stack implementation: (4|6—4|6) scenario
Tunneling: (4—6—4) or (6—4—6) scenarios
Proxying and Translation: (4—6) or (6—4) scenarios

24
Routing Protocols
Routing Protocols
Forwarding?
1
2
Routing: Selection of the best path. R
packets 3
Routing Protocols: 4

Intra domain (with in autonomous system) Inter domain

Distance Vector Link state Path vector


(RIP) (OSPF) (BGP)
(Bellmon-Ford Algorithm) (Dijkstra’s Algorithm)

26
Distance Vector Routing DVR
DVR: Dest. Dist. Next Dest. Dist. Next Dist.

Destination: Distance: Next R1 0 R1 R1 0 R1 1

1. Sharing only neighbor. R2 1 R2 R2 1 R2 0

R1 -> R2 R3 ∞ - R3 7 R2 6
Updated
R2 -> R1,R3,R5 R4 ∞ - R4 ∞ - table of R1 ∞
R1
R3 -> R2,R4 ∞
1 R5 - R5 4 R2 3

R4 -> R3,R5
3
R5 -> R2,R4 Dest. Dist. Next Dest. Dist. Next

2. Only DV R2 R5 R1 ∞ - DV of R2
R1 1 R1
3. Update R2 3 R2

6
R2 0 R2
4 R3 ∞ -
R3 6 R3
R4 4 R4
R4 ∞ -
R5 0 R5
R5 3 R5 R3 R4
Dest. Dist. Next 2 Dest. Dist. Next
At R1
R1 to R2 and R2 to R2
R1 ∞ - R1 ∞ -
1+0=1
R2 6 R2 R2 ∞ - R1 to R2 and R2 to R3
1+6=7
R3 0 R3 R3 2 R3 R1 to R2 and R2 to R4
1 + ∞=∞
R4 2 R4 R4 0 R4 R1 to R2 and R2 to R5
1+3=4
R5 ∞ - R5 4 R5 26
Link State Routing
7
Dijkstra’s Algorithm: (single source shortest path) R2 R4
It use flooding (for reliability) 6 8
Global knowledge
R1 2 1 R6
R1 R2 R3 R4 R5 R6
Seq.No. Seq.No. Seq.No. Seq.No.
3 4
Seq.No. Seq.No. R3 R5
TTL TTL TTL TTL TTL TTL 9
R2 6 R1 6 R1 3 R2 7 R3 9 R4 8
R3 3 R3 2 R2 2 R5 1 R4 1 R5 4

R4 7 R5 9 R6 8 R6 4

R1 R2 R3 R4 R5 R6
6 3 ∞ ∞ ∞
R1,R3 5 3 ∞ 12 ∞
R1,R3,R2 12 12 ∞
R1,R3,R2,R4 1 12 21
R1,R3,R2,R4,R5 16
26
Routing Protocols
Forwarding?
1
2
Routing: Selection of the best path. R
packets 3
Routing Protocols: 4

Intra domain (with autonomous system) Inter domain

Distance Vector Link state Path vector


(RIP) (OSPF) (BGP)
(Bellmon-Ford Algorithm) (Dijkstra’s Algorithm)

26
Dijkstra’s Algorithm
Let the distance of R1 (start router or vertex) from R1 = 0
Let the distance of all other routers from start = ∞ (infinity)

Repeat
visit the unvisited Router with the smallest known distance from the start Router
For the current Router, examine its unvisited neighbors
For the current Router, calculate distance of each neighbor from the start Router
If the calculated distance of a Router is less than known distance, update the shortest distance
Update the previous Router for each of the updated distances
Add the current router to the list of visited routers
Until all Routers visited
Dijkstra’s Algorithm
Let the distance of R1 (start router or vertex) from R1 = 0
Let the distance of all other routers from start = ∞ (infinity)

WHILE Routers remain


visit the unvisited Router with the smallest known distance from the start Router
For the current Router, examine its unvisited neighbors
For the current Router, calculate distance of each neighbor from the start Router
If the calculated distance of a Router is less than known distance, update the shortest distance
Update the previous Router for each of the updated distances
Add the current router to the list of visited routers
Until all Routers visited
References
1. Cisco Networking Academy, CCNA Discovery
2. http://en.wikipedia.org/wiki/List_of_countries_by_IPv4_addr

ess_allocation
3. http://en.wikipedia.org/wiki/IPv6
4. https://en.wikipedia.org/wiki/IPv4_address_exhaustion
5. https://www.google.com/intl/en/ipv6/statistics.html

27
Questions ??

Quiz in the Next Class from this


Chapter

25

You might also like