Professional Documents
Culture Documents
CSC435 Sp2014 Module 1 IP Addressing TCP IP Layers
CSC435 Sp2014 Module 1 IP Addressing TCP IP Layers
n
t ha
IP/MAC Addresses and TCP/IP
na
ha
M ts
Suite
an h
eg
aj rig
ar py
at o
n
ha
• 1.2 Class-based IP Address and Private IP Address
t
na
ha
M ts
• 1.3 Subnetting and CIDR
an h
eg
aj rig
ar py
• 1.4 End-to-End Packet Transmission across the Internet
at o
N lC
Al
n
ha
– Unicast – message sent from one source to one
t
na
destination.
ha
M ts
– Multicast – message sent from one source to multiple
an h
eg
destinations (receivers).
aj rig
– Broadcast – message sent from one source to all the
ar py
other hosts in the network.
at o
N lC
Al
n
ha
• The NIC of a host is typically configured with the
t
na
unicast MAC address for each of its interfaces as
ha
M ts
well as the multicast addresses to which the host
an h
eg
has subscribed to.
aj rig
ar py
at o
device
– there is a 3-byte Organizationally Unique ID (OUI)
• OUI identifies the equipment vendor
• a 3-byte block that identifies a particular NIC
Structure of a MAC Address
n
t ha
na
ha
M ts
an h
eg
aj rig
ar py
at o
N lC
Al
Source: http://en.wikipedia.org/wiki/File:MAC-48_Address.svg
Examples for MAC Address
• Identify whether the following MAC addresses
are global or locally unique and also identify
whether they are multicast or unicast
n
ha
addresses?
t
na
– 0A:5F:BC:AD:23:10
ha
M ts
an h
eg
• Writing the Most Significant Byte (0A) in binary: 00001010;
aj rig
the LSB bits b2 is 1 and b1 is 0. So, the MAC address is a
ar py
locally administered unicast address
at o
N lC
– 49:12:AB:12:CE:FF
Al
t
na
ha
M ts
Private IP Address
an h
eg
aj rig
ar py
at o
N lC
Al
Motivation for IP Address and Port
Numbers
• The MAC address does not change even if we move
around our host to another network/LAN in the Internet.
n
ha
• We need a logical addressing scheme that can be used
t
na
to uniquely identify a machine/NIC in the Internet,
ha
depending on the network to which the machine/NIC is
M ts
an h
eg
attached to.
aj rig
• To distinguish the different applications running on a
ar py
particular host, we assign a unique port number for each
at o
N lC
n
part (prefix) and a host part (suffix).
ha
– Network number (prefix) assignments must be coordinated
t
na
globally
ha
– Suffixes are assigned locally (within a network) without global
M ts
coordination
an h
eg
aj rig
• How many bits to place in each part of an IP address?
ar py
– The prefix needs sufficient bits to allow a unique network number
at o
n
three (3) primary classes
ha
– each class has a different size prefix and suffix
t
na
• The first four bits of an IP address determined the class to which the
ha
M ts
address belonged
an h
eg
aj rig
ar py
at o
N lC
Al
Dotted Decimal Notation
• Dotted decimal notation is a syntactic form that IP software uses to
express the 32-bit number binary values.
• Each 8-bit section of the 32-bit number is represented as a decimal
n
ha
value and periods are used to separate the sections.
t
na
• The first byte of the address in dotted decimal notation can be used
ha
to identify the class of an address
M ts
an h
eg
aj rig
ar py
at o
N lC
Al
Range of IP Addresses and Network
Prefixes for Different Classes
n
hat
na
ha
M ts
an h
eg
aj rig
ar py
at o
N lC
Al
Special IP addresses
• IP defines a set of addresses that are reserved and cannot be
assigned to hosts.
n
ha
Network address
t
na
• Denotes the prefix assigned to a network.
ha
• IP reserves the host suffix containing all 0s for the network address.
M ts
an h
eg
• Thus, a network address cannot be used as the destination address
aj rig
of a packet as it does not refer to any host attached to the network.
ar py
at o
N lC
assigned as 128.11.
Directed Broadcast Address
• Broadcast – Sending a copy of a packet to all the hosts on a
network.
• If the network hardware has the broadcast capability (configured to a
n
broadcast address) then, a single transmission of the packet with the
ha
broadcast address will result in the packet reaching all the hosts on
t
na
the network.
ha
• If the network hardware does not have the broadcast capability, then
M ts
separate copies of the packet must be sent to each host on the
an h
eg
network.
aj rig
ar py
at o
the internet until it reaches the targeted physical network and is then
Al
n
• IP reserves the address consisting of all 1 bits to be used as the
ha
limited broadcast address.
t
na
• Limited broadcast is used during system startup when a computer
ha
M ts
does not know its network number.
an h
eg
aj rig
ar py
• This computer address – used during boot up.
at o
n
communicate over the network. To test these programs without
ha
running them on two different hosts, it is possible to run the two
t
na
application programs on the same host and use the loopback
address to communicate.
ha
M ts
• When data from one application program travels down the protocol
an h
eg
aj rig
stack and reaches the IP software, the packet is forwarded back up
ar py
through the protocol stack to the second application program.
at o
N lC
computer.
• Note that the loopback address never appears on a packet traveling
in a network.
n
ha
Allocates groups of prefixes to
t
Internet Service Providers (ISPs)
na
ha
M ts
ISP
an h
eg
ISP ISP ISP
aj rig
ar py
at o
Distributes prefixes to
N lC
organizations subscribed to it
Al
Org. Org.
Org.
Assigns unique suffix;
combined with a unique prefix
assigned to the org.,
we get a unique IP address
Computer Computer Computer
Private IP Addresses
• IANA reserves certain blocks of IP addresses (called private IP address) for
use by the private internets. The private ip address blocks are:
10.0.0.0 - 10.255.255.255
n
172.16.0.0 - 172.31.255.255
ha
192.168.0.0 - 192.168.255.255
t
na
• The same set of private IP addresses can be used at different organizations
ha
M ts
(i.e., a private IP address has to be only locally unique); where as a public IP
an h
eg
address (all IP addresses other than the above blocks of private IP
aj rig
addresses) has to be globally unique.
ar py
• Private IP addressing is one of the solutions to reduce the exhaustion of IP
at o
address space.
N lC
• The private ip addresses are not routable in the public internet (i.e.,
Al
• For networks connected to the public internet, the service provider makes
the class of IP address to be assigned to an organization’s network; where
as in a private internet, the local administrator selects the class.
Communication between Two
Private IP Addresses
156.10.1.2
n
189.12.1.3
ha
192.168.16.0 192.168.17.0
t
PUBLIC INTERNET
na
ha
M ts
an h
eg
192.168.16.41 192.168.17.10
aj rig
ar py
Public IP Header
at o
Private IP Header
N lC
IP-in-IP Encapsulation
Sample Question: IP Addresses
• Identify whether the following is a network address,
broadcast IP address, unicast IP address, multicast IP
address or a private IP address:
n
ha
a) 143.132.10.1 – unicast IP address for a class B network
t
na
b) 229.0.1.2 – multicast IP address
ha
M ts
c) 16.1.255.255 – unicast IP address for a class A network
an h
eg
aj rig
d) 10.1.1.1 – private IP address
ar py
e) 172.18.12.34 – private IP address
at o
N lC
n
t ha
• Example: Consider a network that contains 9 hosts.
na
• If we have to use classful addressing, we might end up choosing a class C
ha
M ts
address with 8 bits for the suffix, making it possible to support 254 hosts
an h
eg
while we need a network that can support only 9 hosts.
• aj rig
It would be enough to assign 4 bits of host suffix to represent all possible
ar py
host values.
at o
N lC
suffix. Thus, it is possible to create 16 networks such that each can support
a maximum of 14 hosts.
n
• A sequence of 1 bits in the subnet mask represent the network
ha
portion and is followed by a sequence of 0 bits representing the host
t
na
portion.
ha
M ts
• Given an IP address, D and its address mask M, a bitwise AND
an h
eg
aj rig
operation applied over D and M, yields the network prefix portion of
ar py
the address D. The rest of the bits in D then represent the host
at o
n
ha
computers in Departments P, Q and R are 30, 10
t
na
and 47 respectively. Assume organization XYZ
ha
M ts
got a class C network prefix 212.46.98.0. Derive
an h
eg
the following for each of the Departments P, Q
and R: aj rig
ar py
at o
n
01 Q 10 4
ha
Address space. We will use the class-C
10 R 47 6
Address space: 212.46.98.0.
t
na
212 . 46 . 98 . x x x x x x x x
ha
M ts
Subnet Host part – 6 bits
an h
eg
aj rig
Part – 2 bits ar py
Subnet Mask: Sequence of 32 – 6 = 26 1s, followed by 6 0s
at o
N lC
255
Subnet P
Subnet address 212 . 46 . 98 . 0 0 0 0 0 0 0 0 212.46.98.0 / 26
n
ha
62 addresses 212 . 46 . 98 . 0 0 1 1 1 1 1 0 212.46.98.62 / 26
t
na
ha
M ts
an h
eg
Subnet Q
Subnet address aj rig
212 . 46 . 98 . 0 1 0 0 0 0 0 0 212.46.98.64 / 26
ar py
at o
212.46.98.127 / 26
Al
212 . 46 . 98 . 0 1 0 0 0 0 0 1 212.46.98.65 / 26
Range of Valid
IP Addresses
62 addresses
212 . 46 . 98 . 0 1 1 1 1 1 1 0 212.46.98.126 / 26
Subnet R
Subnet address 212 . 46 . 98 . 1 0 0 0 0 0 0 0 212.46.98.128 / 26
212 . 46 . 98 . 1 0 0 0 0 0 0 1 212.46.98.129 / 26
Range of Valid
n
IP Addresses
ha
62 addresses 212 . 46 . 98 . 1 0 1 1 1 1 1 0 212.46.98.190 / 26
t
na
ha
M ts
an h
eg
aj rig
ar py
at o
N lC
Al
n
ha
separate subnet. The number of computers in
t
na
units A, B, C, D and E are 10, 15, 20, 25 and 30
ha
M ts
respectively. Assume the organization got a
an h
eg
aj rig
class B network prefix 202.45.80.0. Derive the
ar py
following for each of the units A, B, C, D and E:
at o
N lC
n
001 B 15 5
ha
Address space. We will use the class-C
010 C 20 5
Address space: 202.45.80.0.
t
na
011 D 25 5
ha
100 E 30 5
M ts
an h
eg
aj rig
ar py
202 . 45 . 80 . x x x x x x x x
at o
N lC
202 . 45 . 80 . 0 0 0 0 0 0 0 1 202.45.80.1 / 27
n
Range of Valid
ha
IP Addresses
t
na
30 addresses
202 . 45 . 80 . 0 0 0 1 1 1 1 0 202.45.80.30 / 27
ha
M ts
an h
eg
Subnet B
aj rig
ar py
Subnet address 202 . 45 . 80 . 0 0 1 0 0 0 0 0 202.45.80.32 / 27
at o
N lC
202 . 45 . 80 . 0 0 1 0 0 0 0 1 202.45.80.33 / 27
Range of Valid
IP Addresses
30 addresses
202 . 45 . 80 . 0 0 1 1 1 1 1 0 202.45.80.62 / 27
Subnet C
Subnet address 202 . 45 . 80 . 0 1 0 0 0 0 0 0 202.45.80.64 / 27
202 . 45 . 80 . 0 1 0 0 0 0 0 1 202.45.80.65 / 27
n
Range of Valid
ha
IP Addresses
t
na
30 addresses
202 . 45 . 80 . 0 1 0 1 1 1 1 0 202.45.80.94 / 27
ha
M ts
an h
eg
Subnet D
aj rig
ar py
Subnet address 202 . 45 . 80 . 0 1 1 0 0 0 0 0 202.45.80.96 / 27
at o
N lC
202 . 45 . 80 . 0 1 1 0 0 0 0 1 202.45.80.97 / 27
Range of Valid
IP Addresses
30 addresses
202 . 45 . 80 . 0 1 1 1 1 1 1 0 202.45.80.126 / 27
Subnet E
Subnet address 202 . 45 . 80 . 1 0 0 0 0 0 0 0 202.45.80.128 / 27
202 . 45 . 80 . 1 0 0 0 0 0 0 1 202.45.80.129 / 27
n
Range of Valid
ha
IP Addresses
t
na
30 addresses
202 . 45 . 80 . 1 0 0 1 1 1 1 0 202.45.80.158 / 27
ha
M ts
an h
eg
aj rig
ar py
at o
N lC
10 + 15 + 20 + 25 + 30
Al
n
ha
200, 400 and 700 hosts. Implement subnetting
t
na
by choosing a proper class-based address
ha
M ts
space. Determine the following for each
an h
eg
division/subnet: aj rig
ar py
– Subnet mask
at o
N lC
– Subnet prefix
Al
n
01 B 400 9
ha
Address space. We will use a class-B
10 C 600 10
Address space: 170.40.0.0.
t
na
170 . 40 . 0 0 0 0 x x x x . x x x x x x x x
ha
M ts
Subnet Host part – 10 bits
an h
eg
aj rig
Part – 2 bits
ar py
Subnet Mask: Sequence of 32 – 10 = 22 1s, followed by 10 0s
at o
N lC
Subnet A
Subnet address 170 . 40 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 170.40.0.0 / 22
n
170 . 40 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 1 0 170.40.0.2 / 22
ha
255 (0.1 .. 0.255)
t
na
256 (1.0 .. 1.255) .
.
ha
256 (2.0 .. 2.255)
M ts
.
an h
eg
255 (3.0 .. 3.254)
aj rig
---- 170 . 40 . 0 0 0 0 0 0 1 1 . 1 1 1 1 1 1 1 0
ar py 170.40.3.254 / 22
1022 IP addresses
at o
N lC
Al
Subnet B
Subnet address 170 . 40 . 0 0 0 0 0 1 0 0 . 0 0 0 0 0 0 0 0 170.40.4.0 / 22
n
170 . 40 . 0 0 0 0 0 1 0 0 . 0 0 0 0 0 0 1 0 170.40.4.2 / 22
ha
255 (4.1 .. 4.255)
t
na
256 (5.0 .. 5.255) .
.
ha
256 (6.0 .. 6.255)
M ts
.
an h
eg
255 (7.0 .. 7.254)
aj rig
---- 170 . 40 . 0 0 0 0 0 1 1 1 . 1 1 1 1 1 1 1 0
ar py 170.40.7.254 / 22
1022 IP addresses
at o
N lC
Al
Subnet C
Subnet address 170 . 40 . 0 0 0 0 1 0 0 0 . 0 0 0 0 0 0 0 0 170.40.8.0 / 22
n
170 . 40 . 0 0 0 0 1 0 0 0 . 0 0 0 0 0 0 1 0 170.40.8.2 / 22
ha
255 (8.1 .. 8.255)
t
na
256 (9.0 .. 9.255) .
.
ha
256 (10.0 .. 10.255)
M ts
.
an h
eg
255 (10.0 .. 10.254)
aj rig
---- 170 . 40 . 0 0 0 0 1 0 1 1 . 1 1 1 1 1 1 1 0
ar py 170.40.11.254 / 22
1022 IP addresses
at o
N lC
n
• Even though subnetting helps us to assign addresses carefully, it
ha
does not get around the fact that any autonomous system with more
t
na
than 255 hosts, wants a class B address.
ha
M ts
• Unless any domain shows a need for something close to 64K
an h
eg
aj rig
addresses, we should not assign them a class B address and instead
ar py
assign an appropriate number of class C addresses to cover the
at o
be that we will require more entries in the routing tables to handle the
Al
n
ha
network numbers, we can assign the class C
t
na
network numbers from 192.4.16 to 192.4.31.
ha
M ts
an h
eg
• The first 20 bits of all the addresses in the above
aj rig
ar py
range would be the same.
at o
N lC
n
ha
that requires the support of 700 hosts and we
t
assign three contiguous class C network
na
address space 212.45.16.0, 212.45.17.0 and
ha
M ts
an h
212.45.18.0. Compute the following for network
eg
PQR: aj rig
ar py
• (1) Subnet mask
at o
N lC
212.45. 0 0 0 1 0 0 1 0. 0
CIDR
---------------------------------
212.45. 0 0 0 1 0 0 0 0 . 0 / 22 Network Prefix/ Network Address
n
ha
212.45.0 0 0 1 0 0 0 0 .0
t
212.45.16.0 / 22
na
ha
M ts
212.45.0 0 0 1 0 0 11 .255
an h
eg
Broadcast IP Address
aj rig
212.45.19.255/ 22
ar py
255.255.11111100.00000000 Subnet Mask
at o
N lC
255.255.252.0
Al
n
context of classless addressing (subnetting and
ha
CIDR). Identify whether the following is a
t
na
subnet/network address, broadcast IP address
ha
M ts
an h
eg
or a unicast IP address:
aj rig
ar py
– 212.40.90.63 / 26
at o
N lC
– 156.23.80.0 / 20
Al
– 199.34.56.32 / 27
– 213.45.1.12 / 28
– 143.132.7.255 /21
Identify the type of classless address
• 212.40.90.63 / 26
All six bits of the host part are 1s. Hence, it
212.40.90.01111111 is a broadcast IP address
n
ha
• 156.23.80.0 / 20
t
All 12 bits of the host part are 0s.
na
156.23.01010000.00000000 Hence, it is a Subnet address
ha
M ts
an h
eg
• 199.34.56.32 / 27
aj rig All five bits of the host part are 0s. Hence, it is a
ar py
199.34.56.00100000 Subnet address
at o
N lC
• 213.45.1.12 / 28
Al
All the four bits of the host part are neither 0s nor
213.45.1.00001100 1s. Hence, it is a unicast IP address
• 143.132.7.255 /21
All the 11 bits of the host part are 1s.
143.132.00000111.11111111 Hence, it is a broadcast IP address
n
hat
na
1.4 End-to-End Packet
ha
M ts
Transmission across the Internet
an h
eg
aj rig
ar py
at o
N lC
Al
Example for End-to-End Packet
Transmission across the Internet
I1 I2 I1 I2
I1 I2 202.78.23.0 R3 190.34.0.0
143.132.0.0 R1 198.90.56.0 R2
n
t ha
H1
na
H2
ha
M ts
an h
eg
Host/ Router IP address Hardware address
H1 aj rig 143.132.0.1 34:12:45:AB:CD:EF
ar py
Interface 1 of R1 143.132.90.2 38:45:A9:E2:B5:C3
at o
N lC
H1 H2
At H1
n
Data Application Layer
ha
Source Dest.
t
Port
na
Port
ha
M ts
21 32 Data Transport Layer
an h
eg
Transport Layer Header
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At Interface 1 of R1
n
t ha
na
ha
M ts
an h
eg
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At Interface 2 of R1
n
t ha
na
ha
M ts
an h
eg
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At Interface 1 of R2
n
t ha
na
ha
M ts
an h
eg
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At Interface 2 of R2
n
t ha
na
ha
M ts
an h
eg
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At Interface 1 of R3
n
t ha
na
ha
M ts
an h
eg
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At Interface 2 of R3
n
t ha
na
ha
M ts
an h
eg
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
H1 H2
At H2
n
Data Application Layer
ha
Source Dest.
t
Port
na
Port
ha
M ts
21 32 Data Transport Layer
an h
eg
Transport Layer Header
aj rig
Source Dest
IP IP
ar py
H1 H2 21 32 Data
at o
Network Layer
N lC
Source Header
Dest
H/w Addr
H/w Addr
n
ha
• The physical layer, network interface and Internet layers are called
t
na
the host-to-host layers as the headers corresponding to these layers
ha
are exposed at each intermediate; whereas, the transport and
M ts
an h
eg
application layers are called as the end-to-end layers as the header
aj rig
and application data corresponding to these layers are seen only at
ar py
the end host. Segment
at o
N lC
Al
Datagram
Frame
Al
N lC
at o
ar py
aj rig
an h
M ts
eg
Model
ha
na
t ha
n
1.5 ISO/OSI Model and TCP/IP
ISO 7-Layer Reference Model
1. Physical layer: Corresponds to the basic network hardware-
transmission of data as a sequence of bits of 1s and 0s
E.g., RS-232 specification
n
t ha
2. Data Link layer: Deals with organization of data into frames and
na
transmission of frames over a network.
ha
M ts
E.g., frame format, byte/bit stuffing, checksum computation
an h
eg
aj rig
3. Network layer: Deals with the specifics of address assignment and
ar py
packet forwarding from one end of the network to another.
at o
N lC
transfer.
n
t ha
na
7. Application layer: Specifies how one particular application uses a
ha
network and contacts the application program running on a remote
M ts
an h
eg
machine.
aj rig
ar py
at o
N lC
Al
n
internetworking was conceived and hence the model does not have
ha
an Internet layer to take care of communication across different
t
na
heterogeneous networks.
ha
• The session layer in the 7-layer model has become less important in
M ts
an h
eg
present day computer systems that are mostly private workstations
aj rig
and not timesharing systems.
ar py
at o
N lC
Al
TCP/IP Protocol Stack
1. Physical Layer: Corresponds to the ISO 7-layer
model’s physical layer.
2. Network Interface Layer: Specifies organization of
n
data into frames and transmission of frames over a
ha
network; similar to the ISO 7-layer model’s data link
t
na
layer.
ha
M ts
3. Internet Layer: Specifies the format of packets sent
an h
eg
aj rig
across an internet and mechanisms to forward packets
from a source computer through one or more routers to a
ar py
final destination.
at o
N lC