LN cn07 IP
LN cn07 IP
INTERNETWORKING
(IP)
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 2
Outline
• Internetworks
– IPv4
• Address Resolution
• IPv6
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 3
IP Networks
• IP is the most widely deployed network layer protocol
worldwide.
• Emerging from a U.S. government sponsored networking
project for the U.S. Department of Defense begun in the 1960s,
the TCP/IP suite has evolved and scaled to support networks
from hundreds of computers to hundreds of millions today.
• The number of devices or hosts on the Internet exceeded 730
million as of early 2010 with average annual additions of over
75 million hosts per year.
• The fact that the Internet has scaled rather seamlessly from a
research project to a network of over 730 million computers is a
testament to the vision of its developers and robustness of their
underlying technology design.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 4
IP Networks
• Growth of Internet hosts during 1993-2010
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 5
IP Networks
• IP was “initially” defined in 1980 in Request for Comments
(RFC) 760 and 791, edited by Jon Postel.
• Postel pointed out in his preface, that RFC 791 is based on six
earlier editions of the ARPAa Internet Protocol, though it is
referred to in the RFC as version 4 (IPv4).
• RFC 791 states that the Internet Protocol performs two basic
functions: addressing and fragmentation.
– Addressing assures unique addressability of hosts
– Fragmentation deals with splitting messages into a number
of IP packets so that they can be transmitted over networks
that have limited packet size constraints, and reassembly of
packets at the destination in the proper order.
a Advanced Research Projects Agency, a U.S. Department of Defense agency
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 6
INTERNETWORKS
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 7
Network
• Hosts are connected via a cloud.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 8
IPv4
• Internet Protocol version 4 (IPv4) is the fourth revision in the
development of the Internet Protocol (IP) and the first version
of the protocol to have been widely deployed.
• Described in IETF (Internet Engineering Task Force)
publication RFC 791 (September 1981), replacing an earlier
definition (RFC 760, January 1980).
• It is a connectionless protocol for use on packet-switched Link
Layer networks
• It operates on a best effort delivery model, in that it does not
guarantee delivery, nor does it assure proper sequencing or
avoidance of duplicate delivery.
• These aspects, including data integrity, are addressed by an
upper layer transport protocol, such as the Transmission
Control Protocol (TCP)
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 9
Internetworks
• Important to be able to interconnect networks to build new
and larger ones.
• LAN approaches are limited: they do not scale well and they
cannot handle heterogeneity.
• An internetwork is an arbitrary collection of networks
interconnected to provide host-to-host packet delivery service.
• The networks are interconnected with special nodes called
routers, and gateways.
• IP is the main protocol for interconnecting: invented by Kahn
and Cerf (December 1997: presented with National Medal of
Technology by Bill Clinton, “for creating and sustaining
development of Internet Protocols and continuing to provide
leadership in the emerging industry of internetworking”).
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 10
Network 3
Network 2
H2
H1
Ethernet
Ethernet
R3
R1 Host Network 4
Router
Point−to−Point
R2
FDDI
Host
Network 1
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 11
Connecting H1 and H2
H1 H2
TCP TCP
R1 R2 R3
IP IP IP
IP IP
ETH FDDI FDDI PPP PPP ETH
ETH ETH
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 12
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 13
IP
• IP is the vehicle for traffic management.
• IP based internets were designed to support delay insensitive
applications.
• Today they face the following design requirements.
– Control congestion
– Provide low delay
– Provide high throughput
– Support QoS
– Provide fair service
• All these issues fall under the category of traffic management.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 14
IPv4 Header
Bits 0 4 8 16 19 31
Version IHL TOS Total Length
IPv4 HEADER
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 15
IPv4 Header
• IP with no options is 20 Bytes.
• IHL is header length in 32-bit words.
• TOS (Type Of Service): provides guidance on selecting next
hop and relative allocation of router resources.
• TOS subfield: provides route selection, subnetwork service,
queuing discipline. These are specified with “certain rules”.
• Procedence Subfield: indicates the degree of urgency from
highest level of “Network Control” to lowest level “Routine”.
These provide appropriate Queue Service and Congestion
Control.
• IPv4 options: Security, Timestamping, Source routing, Route
Recording.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 16
IPv4 TOS−field
Precedence TOS
111 Network Control 1000 Minimize Delay
110 Internetwork Control 0000 Maximize Throughput
101 Critical 0010 Maximize Reliability
100 Flash Override 0001 Minimize Monetary Cost
011 Flash 0000 Normal Service
010 Immediate
001 Priority
000 Routine
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 17
Fragmentation/Reassembly
H1 H2
TCP TCP
R1 R2 R3
IP IP IP
IP IP
ETH FDDI FDDI PPP PPP ETH
ETH ETH
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 18
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 19
IP Addressing
• In addition to physical addresses (contained in NICs) nodes
have 32 bit IP addresses.
• It is a two level hierarchy consisting of the net ID and the Host
ID: net ID identifies the network the host is connected.
• All hosts connected to the same network have the same net ID.
• IP addresses look like:
• The lengths of Class, Net-ID, and Host-ID are variable, but the
total length is 32 bits.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 20
IP Addressing
• There are five classes of addresses: A, B, C, D, E.
Class Net ID Host ID
A 7 bits 24 bits
B 14 bits 16 bits
C 21 bits 8 bits
• D is used for multicasting and E for experiments.
• IDs with all 0s or all 1s are used for broadcasting:
– immediately after booting up a host may not know its ID.
– So host will transmit packets with all 0s while trying to find
out correct ID.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 21
IP Addressing
• Addresses broken into four bytes and written as: X.Y.Z.W in
decimal: 128.135.68.5 = 10000000.10000111.01000100.00000101.
0123 8 16 31
Class A 0 Net ID Host ID
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 22
H H H
H H
Ethernet
H
Token
Ring G G
H
R
H H
R Ethernet
Ethernet
H H H H
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 23
135.17.65.33
Ethernet H
129.7.0.0 135.17.1.2
129.7.14.3 222.13.6.1 222.13.6.5 H
Token
Ring G
223.3.7.0 223.3.7.12 222.13.6.0 G 135.17.1.6
Class C 135.17.2.45 H
R
208.13.6.0 135.17.3.6
208.13.6.0
H H
223.3.7.5 R 208.13.6.1
Ethernet
123.12.3.1 135.17.0.0
Ethernet Class B
123.0.0.0
Class A H H H H
123.12.3.4 123.13.22.15
H = Host G = Gateway R = Router
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 24
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 25
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 26
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 27
Two-level Hierearchy
A network may have a Class B address.
135.27.12.2 135.17.12.5 135.17.22.1 135.27.23.1 135.17.23.5
135.27.0.0
Class B
Because it is a two level hierachy they cannot be grouped into a
“less flat” scheme.
Solution: Subnetting!
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 28
Subnetting
The rest of the internet does not need to be aware of the subnet
division! The Router is aware of subnetting!
135.17.12.5
135.27.12.2
135.27.0.0
Class B
R
135.17.22.1 135.17.23.5
135.27.23.1
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 29
More Levels
Now we have three levels in the hierarchy:
• Net-id (135.17)
• Subnet-id (12, 22, 23)
• Host-id
16
10 Net ID Host ID
Class B
10 Net ID Subnet ID Host ID
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 30
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 31
IP Subnetting/Masking
• Subnetting provides routing boundaries for communications
and routing protocol updates.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 32
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 33
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 34
Subneting
• Subnetting takes a single IP network address and allocates it
to several physical networks referred to as subnets, e.g., a
University Campus, Company, etc.
• Subnets should be physically close to each other.
• Knowing the addresses of a few entry gateways should be
enough.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 35
Subnet Masks
1. The mechanism allowing a network number to be shared
among multiple networks is called subnet masking.
2. This gives rise to the subnet number: all hosts on the same
network have the same subnet number.
3. Hosts on different physical networks share single network #.
4. Subnet masks introduce another level of hierarchy into
IP-addressing.
5. Subnet masks written down like IP addresses, e.g.
255.255.255.3
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 36
Subnet Masks
To share a single class B address use a subnet mask, say
255.255.255.0 = 11111111.11111111.11111111.00000000
I.e., lowest 8 bits are the host numbers.
Address now has three parts: network part, subnet part, and host
part.
16 16
Network Number Host Number
Class B Address
24 1s 8 0s
Subnet Mask: 255.255.255.0
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 37
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 38
H2 128.96.34.139
128.96.34.129
R2
128.96.33.1
H3
128.96.33.14
Subnet Mask: 255.255.255.0
Subnet Number: 128.96.33.0
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 39
Host H1 H2
Subnet Number 128.96.34.15 128.96.34.139
Subnet Mask 255.255.255.128 255.255.255.128
BIT-WISE AND 128.96.34.0 128.96.34.128
H1 forwards to H2: H1 calculates AND of H2’s subnet address
(128.96.34.139) with subnet mask (255.255.255.128). If result is
equal to H1’s Subnet Number (128.96.34.128) then it is deliverd to
NextHop for H2 of its forwarding table. If it is not equal to H1’s
Subnet Number then packet is forwarded to H1’s default router.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 40
Masking: Example
If IP address 150.100.12.176 arrives from outside use a binary AND
between IP address and mask 255.255.255.125 to determine subnet.
IP address 10010110.01100100.00001100.10110000
mask 11111111.11111111.11111111.10000000
AND 10010110.01100100.00001100.10000000
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 41
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 42
ADDRESS RESOLUTION
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 43
Address Resolution
• How to re-translate an IP address to an address understood by
a local host, e.g. an Ethernet address?
• Each host maintains a table of address pairs:
(IP-address, Physical-address)
Table can be managed either by an administrator or better yet
dynamically by the host.
• Translation accomplished by ARP (Address Resolution
Protocol).
• ARP enables hosts to build such tables. Moreover, ARP
performs updating approximately every 15 minutes.
• ARP performs queries that take advantage of broadcasting
capabilities of local networks, like Ethernet.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 44
SourceHardwareAddress
SourceHardwareAddress SourceProtocolAddress
SourceProtocolAddress DestHardwareAddress
DestHardwareAddress
DestProtocolAddress
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 45
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 46
Host
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 47
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 48
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 49
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 50
Reporting Errors
• Whenever a router or host is unable to deliver a message, IP
reports errors.
• IP has a companion protocol, called Internet Control Message
Protocol (ICMP) that defines error messages, including
unreachable destination host, failure of datagram arrival, etc
• Check in your UNIX machine the command ping!
• ICMP control messages include: ICMP-Redirect, that tells the
source host that there is a better route to destination.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 51
Tunneling
Old Virtual Private Networks
A
C
B
D F
E
Network1
Network2
D
C
E
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 52
Tunneling
Router Router
Internetwork
Network 1 R1 R2 Network 2
tunnel
IP Header 10.0.0.1
IP Header Dest = 10.0.0.1 IP Header
Dest = 2.x IP Header Dest = 2.x
Payload Dest = 2.x Payload
Payload
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 53
IPv6
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 54
IPv6
• Surge in demand for IP address space stimulated the IETFa to
define a new version of the Internet Protocol that would
provide more addressing capacity to meet then and anticipated
future address requirements.
• Every Regional Internet Registry (RIR) had issued notifications
to the Internet community at large that IPv4 space availability
is limited and will be exhausted within “a few years.”
• The primary objective for version 6 was essentially to redesign
version 4 based on the prior 20 years of experience with IPv4.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 55
IPv6 Wishlist
• IPv4 not suffiecient!
– Support for real time services.
– Security support.
– Autoconfiguration.
– Enhanced routing functionality (e.g., mobility support).
• Also a transition plan IPv4 → IPv6 was necessary.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 56
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 57
IPv6 Header
• IPv6: designed to accomodate higher speeds. IPv4 uses 32 bit
address space. IPv6 uses 128 bit address. IPv4 can address up
to 232 (= 4 billion) nodes. IPv6 can address up to 2128 = (232 )4
hosts.
• IPv6 Format: An IPv6 packet has the form: IPv6-header,
extension field, · · · , extension header, format level PDU
(Protocol Data Unit).
• IPv6 header:
• Priority Field: defines types of traffic.
• Flow labels: e.g. multimedia traffic consists of audio flow, video
flow, data flow.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 58
IPv6 Header
Has less fields than IPv4 (for less processing).
Bits 0 4 8 16 19 31
Version Priotity Flow Label
IPv6 HEADER
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 59
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 60
DATA Variable
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 61
Assigning Addresses
• Three types of addresses: Unicast, Anycast (different
interfaces), Multicast (different nodes).
• Hop-by-Hop Options Header: carries optional information that
must be examined (like next header, header extension length,
options).
• Fragment Header: fragmentation is done only by source nodes
not routers. Nodes perform a path discovery algorithm to
determine the smaller max transmission unit. With this
knowledge source nodes fragments data. Fragment header has
several flags and data itself.
• Routing Header: contains a list of one or more intermediate
nodes to be visited along the way. Fields include: Next Header,
Header Extension Length, Routing Type, etc Destinations
Options Header: carries optional information.
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 62
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 63
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 64
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 65
Tunneling in IPv6
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 66
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 67
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 68
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 69
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 70
November 6, 2019
Principles of Computer Networks, COMP 3203. Evangelos Kranakis, Carleton University, SCS 71
References
• T. Rooney, Rooney-IP Address Management Principles and
Practice, IEEE, 2011.
• RFC 760, DoD standard Internet Protocol, January 1980
• RFC 761, DoD standard Transmission Control Protocol, 1980.
November 6, 2019