0% found this document useful (0 votes)
25 views

Week11.1 Final

Uploaded by

Enis Mert Kuzu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Week11.1 Final

Uploaded by

Enis Mert Kuzu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

CS 408

Computer Networks

Week 11-1 TCP/IP


IP v4 – Addressing –Subnetting - Routing

1
Reminder

• Final Exam, May 29th Tuesday, 16:30 FMAN G071

• Course Evaluations:
https://sucourse.sabanciuniv.edu/mynotif-
tool/goToEvaluationDashboard.jsp

2
Protocol Suites

TCP/IP Protocol Suite : Now IP


• An open standard
protocol suite: freely
available to the public
and can be used by any
vendor
• Endorsed by the
networking industry and
approved by a standards
organization to ensure
interoperability
• IETF, ISOC, ITU
Switches vs Routers

4
Switch
 Switch is a link-layer device: takes an active role
• Uses MAC addresses
• store, forward frames
• examine incoming frame’s MAC address, selectively forward
frame to one-or-more outgoing links when frame is to be
forwarded on segment,
 transparent: hosts unaware of presence of switches
 plug-and-play, self-learning
• switches do not need to be configured

Link Layer: 6-5


6
Routers (Layer-3) – Switches (Layer-2)
How many IP networks?

Internet
IP addressing: 223.1.1.2

introduction
223.1.1.1
223.1.1.4

• IP address: 32-bit identifier 223.1.1.3


associated with each interface
• interface: connection between 223.1.9.2 223.1.7.0

host/router and physical link


—router’s typically have multiple 223.1.9.1 223.1.7.1
interfaces 223.1.8.1 223.1.8.0

—host typically has one or two 223.1.2.6 223.1.3.27

interfaces (e.g., wired Ethernet,


223.1.2.1
wireless 802.11) 223.1.2.3 223.1.3.1 223.1.3.2

192.168.56.8
223.1.1.2

IP address structure 223.1.1.1


223.1.1.4

• Network address part 223.1.1.3

223.1.9.2 223.1.7.3

• Host Interface part

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.5

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.3 223.1.3.1 223.1.3.2

9
Some Special IP address forms
Prefix Suffix Type & Meaning
(network) (host)
all zeros all zeros this computer 0.0.0.0
network address all zeros identifies network x.0.0.0 x.x.0.0 x.x.x.0

network address all ones broadcast on the


x.x.255.255 x.x.x.255
specified network
all ones all ones broadcast on local
network 255.255.255.255
127 any loopback (for testing
purposes) 127.0.0.1
Private Network Addresses (for local use)
• 10.0.0.0 – 10.255.255.255 for private networks (Class A)

• 172.16.0.0 - 172.31.255.255 for private networks (Class B)

• 192.168.0.0 - 192.168.255.255 for private networks (Class C)

Step-1 Check your IPv4 address from device settings Are they different?
Step-2 Check with Google: «My IP address» or whatismyip.com 11
Subnets (Departments, Divisions, etc.)
 What’s a subnet ? 223.1.1.1

• device interfaces that can 223.1.2.1

physically reach each other 223.1.1.2


223.1.1.4 223.1.2.9
without passing through an
intervening router 223.1.3.27
223.1.1.3
223.1.2.2

 IP addresses have structure:


• subnet part: devices in same subnet
have common high order bits 223.1.3.1 223.1.3.2

• host part: remaining low order bits


network consisting of 3 subnets
Subnets and Subnet Masks
• A network with several subnets looks like a single network from the point of
view of the rest of internet
• Each subnet is assigned a subnet number
• Host portion of address partitioned into subnet number and host number
• Local internal routers route within subnetted network
• Subnet mask indicates which bits are network/subnet number and which are
host number
—Subnet mask must be in the form of several 1's followed by several 0's -
111..111000…0
—number of 0's is used to determine the number of hosts in that subnet (see
next example)
The Subnet Mask

• To identify the network and host portions of an IPv4 address, the subnet mask is
compared to the IPv4 address bit for bit, from left to right.
• IP address 192.168.10.10 Subnet mask: 255.255.255.0

• The actual process used to


identify the network and
host portions is called
ANDing.
Determining the Network: Logical AND
• A logical AND Boolean operation is used in determining the network address.
• Logical AND is the comparison of two bits where only a 1 AND 1 produces a
1 and any other combination results in a 0.

• To identify the network


address, the host IPv4
address is logically ANDed,
bit by bit, with the subnet
mask to identify the network
address.
Classless Addresses - (variable-length
subnet masks VLSM)
• CIDR (Classless Inter-Domain Routing)
• Extension of subnet idea to the whole Internet
• Assigning IP numbers by partitioning network and host parts at any
bit position (No need for A, B, C classes)
• A precaution against exhaustion of IP addresses
• Special notation (CIDR notation)
—network address/number of 1-bits in the mask
nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
—144.122.0.0/16 255.255.0.0
11111111.11111111.00000000.00000000

— 144.122.36.0/24 255.255.255.0 nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh


11111111.11111111.11111111.00000000
The Prefix Length – Classless - CIDR
Prefix
Subnet Mask 32-bit Address Lengt
h
• A prefix length is a less
cumbersome method used to 255.0.0.0 11111111.00000000.00000000.00000000 /8
identify a subnet mask address.
255.255.0.0 11111111.11111111.00000000.00000000 /16

255.255.255.0 11111111.11111111.11111111.00000000 /24

• The prefix length is the number 255.255.255.128 11111111.11111111.11111111.10000000 /25


of bits set to 1 in the subnet
mask. 255.255.255.192 11111111.11111111.11111111.11000000 /26

255.255.255.224 11111111.11111111.11111111.11100000 /27


• It is written in “slash notation”
therefore, count the number of 255.255.255.240 11111111.11111111.11111111.11110000 /28
bits in the subnet mask and
prepend it with a slash. 255.255.255.248 11111111.11111111.11111111.11111000 /29

255.255.255.252 11111111.11111111.11111111.11111100 /30


Subnet on an Octet Boundary

• Networks are most easily subnetted at the octet boundary of /8, /16, and /24.

• Notice that using longer prefix lengths decreases the number of hosts per subnet.

Prefix
Subnet Mask Subnet Mask in Binary (n = network, h = host) # of hosts
Length

nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
/8 255.0.0.0 11111111.00000000.00000000.00000000 16,777,214

nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
/16 255.255.0.0 11111111.11111111.00000000.00000000 65,534

nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
/24 255.255.255.0 11111111.11111111.11111111.00000000 254
Subnet on an Octet Boundary (Cont.)

• In the first table 10.0.0.0/8 is subnetted using /16 and in the second table, a /24 mask.
Subnet Address Host Range Subnet Address
Host Range
(256 Possible (65,534 possible hosts per Broadcast (65,536 Possible Broadcast
(254 possible hosts per subnet)
Subnets) subnet) Subnets)

10.0.0.0/16 10.0.0.1 - 10.0.255.254 10.0.255.255 10.0.0.0/24 10.0.0.1 - 10.0.0.254 10.0.0.255


10.0.1.0/24 10.0.1.1 - 10.0.1.254 10.0.1.255
10.1.0.0/16 10.1.0.1 - 10.1.255.254 10.1.255.255
10.0.2.0/24 10.0.2.1 - 10.0.2.254 10.0.2.255
10.2.0.0/16 10.2.0.1 - 10.2.255.254 10.2.255.255
… … …
10.3.0.0/16 10.3.0.1 - 10.3.255.254 10.3.255.255
10.0.255.0/24 10.0.255.1 - 10.0.255.254 10.0.255.255
10.4.0.0/16 10.4.0.1 - 10.4.255.254 10.4.255.255 10.1.0.0/24 10.1.0.1 - 10.1.0.254 10.1.0.255

10.5.0.0/16 10.5.0.1 - 10.5.255.254 10.5.255.255 10.1.1.0/24 10.1.1.1 - 10.1.1.254 10.1.1.255


10.1.2.0/24 10.1.2.1 - 10.1.2.254 10.1.2.255
10.6.0.0/16 10.6.0.1 - 10.6.255.254 10.6.255.255
… … …
10.7.0.0/16 10.7.0.1 - 10.7.255.254 10.7.255.255
10.100.0.0/24 10.100.0.1 - 10.100.0.254 10.100.0.255
... ... ...
... ... ...

10.255.0.0/16 10.255.0.1 - 10.255.255.254 10.255.255.255 10.255.255.0/24 10.255.255.1 - 10.2255.255.254 10.255.255.255


144.122.0.0
• How many IP numbers?

20
144.122.0.0
• 144.122.0.0/?
• How many IP numbers?
• I want to distribute addresses to
departments (subnets)

nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
11111111.11111111.11111111.00000000
21
CEng wanted to have 4 networks, solution?
• 144.122.71.0
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
11111111.11111111.11111111.00000000

• 4 networks with 64 addresses


• 144.122.71.0/26
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
11111111.11111111.11111111.11000000

22
Ceng wanted to have 4 networks, solution?
• 144.122.71.0 / 25
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
11111111.11111111.11111111.11000000

• 144.122.71.0 .... 144.122.71.63


—First one network last one broadcast

• 144.122.71.64 .... 144.122.71.127


• 144.122.71.128 .... 144.122.71.191
• 144.122.71.192 .... 144.122.71.255

23
CEng wanted to have 8 networks, solution?
• 144.122.71.0
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
11111111.11111111.11111111.00000000

• 8 networks with 32 addresses


• 144.122.71.0/27
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
11111111.11111111.11111111.11100000
Routing Using Subnets (Example)

Subnet Mask: /27


255.255.255.224
Last octet is for Subnet number and Host
number
224 -> 11100000 in binary last 5 bits are for
Host number, previous 3 bits are for Subnet
number

• 192.228.17.0 /27
• 8 networks with 32 addresses
• LAN X : 192.228.17.32 – 192.228.17.63
• LAN Y: 192.228.17.64 – 192.228.17.95
• LAN Z:?
What if I want 3 x 64 and 2 x 32 networks

26
Subnet within an Octet Boundary

• Refer to the table to see six ways to subnet a /24 network (e.g. 192.165.8.x)
Prefix Subnet Mask in Binary # of
Subnet Mask # of hosts
Length (n = network, h = host) subnets

nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 11111111.11111111.11111111.10000000 2 126

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 11111111.11111111.11111111.11000000 4 62

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 11111111.11111111.11111111.11100000 8 30

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 11111111.11111111.11111111.11110000 16 14

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 11111111.11111111.11111111.11111000 32 6

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 11111111.11111111.11111111.11111100 64 2
IP addresses: how to get one?
Q: how does network get subnet part of IP address?
A: gets allocated portion of its provider ISP’s address space
ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

ISP can then allocate out its address space in smaller blocks:
Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23
Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Network Layer: 4-28


Example:
• e.g. 128.140.168.0/21 nnnnnnnn.nnnnnnnn.nnnnnhhh.hhhhhhhh
—subnet mask is 255.255.248.0 11111111.11111111.11111000.00000000
—Lowest host address? 10000000.10001100.10101000.00000000
—Highest host address?

• 128.140.168.1 10000000.10001100.10101000.00000001

• 128.140.175.254 10000000.10001100.10101111.11111110

• Using classless addresses to generate several subnetworks will also be explained in lab and you will
have a quiz on this.
29
Hierarchical addressing: route
aggregation
hierarchical addressing allows efficient advertisement of routing
information:
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Türk Telekom 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
Vodafone with addresses
beginning
199.31.0.0/16”
Hierarchical addressing: more
specific routes
 Organization 1 moves from Türk Telekom to Vodafone
 ISPs-R-Us now advertises a more specific route to Organization 1
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Türk Telekom 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
Vodafone with addresses
Organization 1 beginning
199.31.0.0/16”
200.23.18.0/23 “or 200.23.18.0/23”
Hierarchical addressing: more
specific routes
 Organization 1 moves from Türk Telekom to Vodafone
 Vodafone now advertises a more specific route to Organization 1
Organization 0
200.23.16.0/23

“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Türk Telekom 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
Vodafone with addresses
Organization 1 beginning
199.31.0.0/16”
200.23.18.0/23 “or 200.23.18.0/23”

Network Layer: 4-32


IP addresses: how does a host get it?

Q: How does a host get IP address within its network (host part of
address)?
 hard-coded by sysadmin in config file (e.g., /etc/rc.config in UNIX)
 DHCP: Dynamic Host Configuration Protocol: dynamically get address from as
server
• “plug-and-play”
DHCP: Dynamic Host Configuration Protocol

goal: host dynamically obtains 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/on)
 support for mobile users who join/leave network

DHCP overview:
 host broadcasts DHCP discover msg [optional]
 DHCP server responds with DHCP offer msg [optional]
 host requests IP address: DHCP request msg
 DHCP server sends address: DHCP ack msg
DHCP client-server scenario
Typically, DHCP server will be co-
DHCP server located in router, serving all subnets
223.1.1.1
223.1.2.1
to which router is attached

223.1.2.5
223.1.1.2
223.1.1.4 223.1.2.9

223.1.1.3
223.1.3.27 arriving DHCP client needs
223.1.2.2 address in this network

223.1.3.1 223.1.3.2

Network Layer: 4-37


DHCP client-server scenario
DHCP server: 223.1.2.5 DHCP discover Arriving client
src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server0.0.0.0
out there?
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server!
yiaddr:Here’s an IP
223.1.2.4
transaction ID: 654
address you can use
lifetime: 3600 secs
The two steps above can
DHCP request be skipped “if a client
src: 0.0.0.0, 68 remembers and wishes to
dest:: 255.255.255.255, 67
Broadcast: OK. I would reuse a previously
yiaddr: 223.1.2.4
like to transaction
use this ID:IP 655
address! allocated network address”
[RFC 2131]
lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
Broadcast: OK. You’ve
yiaddr: 223.1.2.4
got that IPID:address!
transaction 655
lifetime: 3600 secs
Network Layer: 4-38
DHCP: more than IP addresses
DHCP can return more than just allocated IP address on
subnet:
 address of first-hop router for client
 name and IP address of DNS server
 network mask (indicating network versus host portion of address)

 Unused address (e.g. Detaching PC) is returned to the pool


for reuse when the lease expires

Network Layer: 4-39


NAT: network address translation
NAT: all devices in local network share just one IPv4 address as
far as outside world is concerned
rest of local network (e.g., home
Internet network) 10.0.0/24

10.0.0.1
138.76.29.7 10.0.0.4

10.0.0.2

10.0.0.3

all datagrams leaving local network have datagrams with source or destination in
same source NAT IP address: 138.76.29.7, this network have 10.0.0/24 address for
but different source port numbers source, destination (as usual)
NAT: network address translation
 all devices in local network have 32-bit addresses in a “private” IP
address space (10/8, 172.16/12, 192.168/16 prefixes) that can only
be used in local network
 advantages:
 just one IP address needed from provider ISP for all devices
 can change addresses of host in local network without notifying
outside world
 can change ISP without changing addresses of devices in local
network
 security: devices inside local net not directly addressable, visible
by outside world
NAT: network address translation
implementation: NAT router must (transparently):
 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 address
 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
destination fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table
NAT: network address translation
NAT translation table
2: NAT router changes 1: host 10.0.0.1 sends
WAN side addr LAN side addr datagram to
datagram source address
138.76.29.7, 5001 10.0.0.1, 3345 128.119.40.186, 80
from 10.0.0.1, 3345 to
138.76.29.7, 5001, …… ……
updates table
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
10.0.0.1
1
S: 138.76.29.7, 5001
2 D: 128.119.40.186, 80 10.0.0.4
10.0.0.2
138.76.29.7 S: 128.119.40.186, 80
D: 10.0.0.1, 3345
4
S: 128.119.40.186, 80 10.0.0.3
D: 138.76.29.7, 5001 3
3: reply arrives, destination
address: 138.76.29.7, 5001

extensively used in home and institutional nets, 4G/5G cellular nets


If you need static IP (Why?)

Do you need more addresses? https://auctions.ipv4.global/

What is the value of a B-Class address? e.g. 144.122.0.0


IP v6 - Version Number
• IP v 1-3 defined and replaced
• IP v4 - current version
• IP v5 - stream protocol
—Connection oriented internet layer protocol
• IP v6 - replacement for IP v4
—Not compatible with IP v4
—During the initial development it was called IPng (Next Generation)
IPv6 RFCs and Address Plan
 RFC 2460 - Overall specification (December 1998)
 RFC 2373 - Addressing structure
 RFC 3627 (2003)
Use of /127 Prefix Length Between Routers Considered Harmful
 RFC 5375 (2008)
IPv6 Unicast Address Assignment Considerations
 RFC 6164 (April 2011)
Using 127-Bit IPv6 Prefixes on Inter-Router Links

Resources:
RIPE - Preparing an IPv6 Addressing Plan Manual
http://www.ripe.net/training/material/IPv6-for-LIRs-Training-Course/IPv6_addr_plan4.pdf
:

ARIN wiki - IPv6 Addressing Plan


http://www.getipv6.info/index.php/IPv6_Addressing_Plans

IPv6 Geçiş Eğitimi kapsamında TÜBİTAK ULAKBİM tarafından hazırlanan bu döküman Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 lisansı veya seçiminize göre daha güncel sürümlerine göre kullanılabilir.
Driving Motivation to change IP
• Address space exhaustion
—Two level addressing (network and host) wastes space
—Growth of networks and the Internet
—Extended use of TCP/IP
• e.g. for POS terminals
• Wireless nodes
• Vehicles
• Current trend: Internet of Things
IPv6 Enhancements

 Expanded address space – 128 bit


 New security options
 Simplified header structure
 Improved option mechanism for quality of service
 Support for resource allocation
 Labeling of packets for particular traffic flow e.g. real time video
 Neighbor Discovery with ICMP

IPv6 Geçiş Eğitimi kapsamında TÜBİTAK ULAKBİM tarafından hazırlanan bu döküman Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 lisansı veya seçiminize göre daha güncel sürümlerine göre kullanılabilir.
Header Structure
IPv4 Header IPv6 Header

IPv6 Geçiş Eğitimi kapsamında TÜBİTAK ULAKBİM tarafından hazırlanan bu döküman Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 lisansı veya seçiminize göre daha güncel sürümlerine göre kullanılabilir.
Driving Motivation to change IP

• Address space exhaustion


—Two level addressing (network and host) wastes space
—Growth of networks and the Internet
—Extended use of TCP/IP
• e.g. for POS terminals
• Wireless nodes
• Vehicles
• Current trend: Internet of Things
IPv6 Addresses
• 128 bits long
• Assigned to interface
— An interface may have multiple addresses
• network/host id parts
— arbitrary boundary
— like CIDR addresses in v4
• Multilevel hierarchy
— ISP - Organization - Site - …
— Helps faster routing due to aggregation of IP addresses
• Smaller routing tables and faster lookup
• IPv4 addresses are mapped into v6 addresses
• Three types of address: unicast, anycast, multicast
Types of address
• Unicast
— an address that is assigned to a single interface
• Anycast
—Set of computers (interfaces) that share a single address
—Delivered to any one interface
• the “nearest” (to most optimal device)
—redundancy, load balancing, and efficient content distribution
• Multicast
—One address for a set of interfaces/computers
—Delivered to all interfaces/computers identified by that address
—streaming, video conferencing, online gaming, distributed applications
IPv6 Addresses
• 128 bit

0010000000000001000011011011100000000000000000000000000000000000
0000001010101010000000001111111111111110001010001001110001011010

0010000000000001 0000110110111000 0000000000000000 0000000000000000


0000001010101010 0000000011111111 1111111000101000 1001110001011010

IPv6 addresses are grouped in 16 bits length – 8 groups

IPv6 Geçiş Eğitimi kapsamında TÜBİTAK ULAKBİM tarafından hazırlanan bu döküman Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 lisansı veya seçiminize göre daha güncel sürümlerine göre kullanılabilir.
IPv6 Adresses
• An example IPv6 address
0010000000000001 0000110110111000 0000000000000000 0000000000000000
0000001010101010 0000000011111111 1111111000101000 1001110001011010

• In IPv6, a hextet is the unofficial term used to refer to a


segment of 16 bits, or four hexadecimal values, seperated by :

2001:0DB8:0000:0000:02AA:00FF:FE28:9C5A

IPv6 Geçiş Eğitimi kapsamında TÜBİTAK ULAKBİM tarafından hazırlanan bu döküman Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 lisansı veya seçiminize göre daha güncel sürümlerine göre kullanılabilir.
IPv6 Address Representation
Rule 1 – Omit Leading Zero ***
The first rule to help reduce the notation of IPv6 addresses is to omit any leading 0s (zeros).
Examples:
• 01ab can be represented as 1ab
• 09f0 can be represented as 9f0
• 0a00 can be represented as a00
• 00ab can be represented as ab

Note: This rule only applies to leading 0s, NOT to trailing 0s, otherwise the address would be
ambiguous.

Type Format

Original 2001 : 0db8 : 0000 : 1111 : 0000 : 0000 : 0000 : 0200


No leading zeros 2001 : db8 : 0 : 1111 : 0 : 0 : 0 : 200
IPv6 Address Representation
Rule 2 – Double Colon ***

A double colon (::) can replace any single, contiguous string of one or more
16-bit hextets consisting of all zeros.
Example:
• 2001:db8:cafe:1:0:0:0:1 (leading 0s omitted) could be represented as 2001:db8:cafe:1::1

Warning: The double colon (::) can only be used once within an address, otherwise there
would be more than one possible resulting address.

Type Format
Original 2001 : 0db8 : 0000 : 1111 : 0000 : 0000 : 0000 : 0200
Compressed 2001:db8:0:1111::200
Example (Hint:double colon (::) can only be used once within an address)

2001:0db8:0000:0000:b450:0000:0000:00b4

2001:db8::b450::b4
2001:db8::b450:0:0:b4
2001:db8::b45:0000:0000:b4
2001:db8:0:0:b450::b4
Conversion of IPv4 addresses to IPv6

• to manage and integrate IPv4 addresses into IPv6 networks

• by adding prefix ::ffff:0: to the leftmost side of the address, followed


by the IPv4 address in its usual dot-decimal notation.
• e.g. 192.0.2.1
• IPv6 prefix for IPv4-mapped addresses is ::ffff:0:
• Convert 192.0.2.1 to hex c000:0201
• ::ffff:c000:0201
Subnet an IPv6 Network
Subnet Using the Subnet ID
IPv6 was designed with subnetting in mind.
• A separate subnet ID field in the IPv6 is used to create subnets.
• The subnet ID field is the area between the Global Routing Prefix and the interface
ID.
Header Structure
IPv4 Header IPv6 Header

IPv6 Geçiş Eğitimi kapsamında TÜBİTAK ULAKBİM tarafından hazırlanan bu döküman Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 lisansı veya seçiminize göre daha güncel sürümlerine göre kullanılabilir.
IPv6 Extension Headers
• Hop-by-Hop Options
— special options that require hop-by-hop processing
• Routing
— Similar to source routing
• Fragment
— fragmentation and reassembly information
• Authentication
— Integrity and Authentication
• Encapsulating security payload
— Privacy and Confidentiality (plus optional authentication)
• Destination options
— Optional info to be processed at destination node
Migration to IPv6
• Not an overnight operation
—lots of investments in v4 networking equipment and software
—currently equipment and software are all IPv6 compatible
—however, turning the key on synchronously all around the world is not easy
• Specialized networks of small devices with IPv6 addresses
—e.g. a network of sensors that covers a large area for security protection
• Some co-existence strategies
—With prior negotiation IPv6 is used
IPv6 Enhancements (1)

IPv6 Enhancements (2)
• Support for resource allocation
—Labeling of packets for particular traffic flow
—Allows special handling
• e.g. real time video
IPv6 Header
IP v6 Header Fields (1)
• Version
— 6 (in binary: 0110)
• DS/ECN
—Previously, Traffic Class (Types of Service)
• Classes or priorities of packet
—Now interpretation is different as discussed in v4
• Flow Label
—Identifies a sequence of packets (a flow) that has special handling
requirements
• Payload length
—Length of all extension headers plus user data
IP v6 Header Fields (2)
• Next Header
— Identifies type of header
• Extension header or next layer up
• Hop Limit
— Remaining number of hops
— As in TTL of IPv4, decremented by one at each router
— Packet discarded if reaches zero
• Source Address
• Destination address

• Longer header but less number of fields


— simplified processing
Flow Label
• Flow
—Sequence of packets from a particular source to a particular destination
—Source desires special handling by routers
—Uniquely identified by source address, destination address, and 20-bit flow
label
• Router's view
—Sequence of packets that share some attributes affecting how packets
handled
• Path, resource allocation, discard needs, security, etc.
—Handling must somehow be arranged a priori
• Negotiate handling ahead of time using a control protocol (not to be discussed in CS
408)
Differences Between v4 and v6 Headers
• No header length (IHL) in v6
— main header is of fixed length in v6 and extension layers are counted in
the payload length header
• No Protocol info in v6
—next header field will eventually point to the transport layer protocol
• No fragmentation related fields in v6 base header
—fragmentation is an extension header
• No checksum in v6
—rely on reliable transmission medium and checksums of upper and lower
layers
• Flow label is part of base header in v6
—it was in the options part in v4
IPv6 Addresses
• 128 bits long
• Assigned to interface
— An interface may have multiple addresses
• network/host id parts
— arbitrary boundary
— like CIDR addresses in v4
• Multilevel hierarchy
— ISP - Organization - Site - …
— Helps faster routing due to aggregation of IP addresses
• Smaller routing tables and faster lookup
• IPv4 addresses are mapped into v6 addresses
• Three types of address: unicast, anycast, multicast
Types of address
• Unicast
— an address that is assigned to a single interface
• Anycast
—Set of computers (interfaces) that share a single address
—Delivered to any one interface
• the “nearest”
• Multicast
—One address for a set of interfaces/computers
—Delivered to all interfaces/computers identified by that address
IPv6 Extension Headers
Hop-by-hop Options
• Next header
• Header extension length
• Options
— Type (8 bits), length (8 bits) , option data (variable size)
• type also says what should router do if it does not recognize the option
— Pad1 / Pad N
• Insert one/N byte(s) of padding into Options area of header
• Ensure header is multiple of 8 bytes
— Jumbo payload (Jumbogram)
• Option data field (32 bits) gives the actual length of packet in octets
– excluding the base IPv6 header
• For packets over 216 -1 = 65,535 octets, we use this option
– up to 232 octets
– for large video packets
— Router alert
• Tells the router that the content of packet is of interest to the router
• Provides support for Resource Reservation Protocol (RSVP)
Fragment Header
• Fragmentation is only allowed at source
• No fragmentation at intermediate routers
• Node must perform path discovery to find smallest MTU (max.
transmission unit) of intermediate networks
—iterative process
• Source fragments to match MTU
• Otherwise limit to 1280 octets
—1280 is the minimum supported by each network
Fragment Header Fields

• Next Header
• Fragmentation offset
—as in v4
• More flag
—as in v4
• Identification
—as in v4
Routing Header
• Source routing method of IPv6
• List of intermediate nodes to be visited
• Next Header
• Header extension length
• Routing type
• Segments left
—i.e. number of nodes still to be visited
Routing Header
• Type 0 routing
— The only one defined in RFC
2460
• Base header contains the
address of next router
• Router examines the
routing header and
replaces the address in
the base header before
forwarding

Ultimate
destination
address
Destination Options
• Same format as Hop-by-Hop options header
• RFC 2460 defines Pad 1/Pad N as in hop-by-hop options header
Migration to IPv6
• Not an overnight operation
—lots of investments in v4 networking equipment and software
—currently equipment and software are all IPv6 compatible
—however, turning the key on synchronously all around the world is not
easy
• Specialized networks of small devices with IPv6 addresses
—e.g. a network of sensors that covers a large area for security protection
• Some co-existence strategies
—With prior negotiation IPv6 is used
IPv4 and IPv6 Security
• Section 16.6
• IPSec
• Security within the IP level
—so that all upper level applications will be secured
—Integrity, authentication and encryption
—End-to-end, although IP is not end to send
• A very brief summary is given next
IPSec Scope
• Authentication header (AH)
—Authentication and integrity
• Encapsulated Security Payload (ESP)
—encryption + optional (authentication + integrity)
• Key exchange
—Oakley, IKE, ISAKMP
• RFC 2401,2402,2406,2408,2409
Security Association
• Identifies security relationship between sender and receiver
• Details are at local databases
• Security Associations are identified by Security Parameter Indices
Authentication Header
ESP Packet

Next Header identifies the first header in the payload


Transport and Tunnel Modes
• Transport mode
—Protection coverage is the payload of IP packet
• generally headers are not included
—Protection for upper layer protocol
—End to end between hosts
• Tunnel mode
—Protection for the entire IP packet
—Entire packet treated as payload for "outer" IP packet
—No routers examine inner packet and its header
—End to end but between source router to destionation router connection
—VPNs (Virtual Private Networks) are constructed in this way

You might also like