Beruflich Dokumente
Kultur Dokumente
Network Layer
Agenda
• Network Layer
• Internet Protocol
• IP Datagram
• NAT
• Subneting
Network Layer 2
The Internet Network layer
Host, router network layer functions:
Link layer
physical layer
Network Layer 3
IP datagram format
IP protocol version 32 bits
number total datagram
header length length (bytes)
ver head. type of length
(bytes) len service for
“type” of data fragment
16-bit identifier flgs fragmentation/
offset
max number time to upper reassembly
Internet
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to Options (if any) E.g. timestamp,
record route
how much overhead data taken, specify
with TCP? (variable length, list of routers
20 bytes of TCP typically a TCP to visit.
20 bytes of IP or UDP segment)
= 40 bytes + app
layer overhead
Network Layer 4
IP Fragmentation & Reassembly
• network links have MTU
(max.transfer size) - largest
possible link-level frame.
– different link types, different fragmentation:
MTUs in: one large datagram
• large IP datagram divided out: 3 smaller datagrams
(“fragmented”) within net
– one datagram becomes
several datagrams
reassembly
– “reassembled” only at final
destination
– IP header bits used to identify,
order related fragments
Network Layer 5
IP Fragmentation and Reassembly
length ID fragflag offset
Example =4000 =x =0 =0
4000 byte datagram
One large datagram becomes
MTU = 1500 bytes
several smaller datagrams
Network Layer 6
IP Addressing: introduction
223.1.1.1
• IP address: 32-bit
identifier for host, router 223.1.2.1
223.1.1.2
interface 223.1.1.4 223.1.2.9
• interface: connection
223.1.2.2
between host/router and 223.1.1.3 223.1.3.27
physical link
– router’s typically have
multiple interfaces 223.1.3.1 223.1.3.2
– host may have multiple
interfaces
– IP addresses associated
with each interface 223.1.1.1 = 11011111 00000001 00000001 00000001
223 1 1 1
Network Layer 7
Subnets
223.1.1.1
• IP address:
– subnet part (high order 223.1.2.1
223.1.1.2
bits) 223.1.1.4 223.1.2.9
– host part (low order bits)
223.1.2.2
• What’s a subnet ? 223.1.1.3 223.1.3.27
– device interfaces with
same subnet part of IP LAN
address 223.1.3.2
223.1.3.1
– can physically reach each
other without intervening
router
network consisting of 3 subnets
Network Layer 8
Subnets
223.1.1.0/24
223.1.2.0/24
Recipe
• To determine the subnets,
detach each interface
from its host or router,
creating islands of isolated
networks. Each isolated
network is called a
subnet.
223.1.3.0/24
Subnet mask: /24
Network Layer 9
Subnets 223.1.1.2
223.1.1.3
223.1.9.2 223.1.7.0
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
Network Layer 10
IP addresses: how to get one?
Network Layer 11
IP addressing: the last word...
Network Layer 12
NAT: Network Address Translation
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
Network Layer 13
NAT: Network Address Translation
Network Layer 15
NAT: Network Address Translation
NAT translation table
2: NAT router 1: host 10.0.0.1
WAN side addr LAN side addr
changes datagram sends datagram to
138.76.29.7, 5001 10.0.0.1, 3345 128.119.40, 80
source addr from
…… ……
10.0.0.1, 3345 to
138.76.29.7, 5001, S: 10.0.0.1, 3345
updates table 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
D: 138.76.29.7, 5001 3 10.0.0.3
4: NAT router
3: Reply arrives changes datagram
dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345
Network Layer 16
NAT: Network Address Translation
Network Layer 17
The 32 bit Binary IP Adress
• An IP address is represented by a 32 bit binary
number
• The value of the right-most bit (also called the least
significant bit) is either 0 or 1
• The corresponding decimal value of each bit doubles
as you move left in the binary number
• So the decimal value of the 2nd bit from the right is
either 0 or 2. The third bit is either 0 or 4, the fourth
bit 0 or 8, etc ...
• IP addresses are expressed as dotted-decimal
numbers
• we break up the 32 bits of the address into four
octets (an octet is a group of 8 bits).
Network Layer 18
• The maximum decimal value of each octet is 255
• The largest 8 bit binary number is 11111111
• Those bits, from left to right, have decimal values of
128, 64, 32, 16, 8, 4, 2, and 1. Added together, they
total 255
Network Layer 19
Network Layer 20
• The network number of an IP address identifies the
network to which a device is attached
• The host portion of an IP address identifies the
specific device on that network
Network Layer 21
Network Layer 22
• When written in a binary format, the first (leftmost) bit of a Class
A address is always 0.
• Example of a Class A IP address is 124.95.44.15
• The first octet, 124, identifies the network number assigned by
ARIN
• which will range from 0-126. (127 does start with a 0 bit, but has
been reserved for special purposes.)
• The internal administrators of the network assign the remaining
24 bits
• All Class A IP addresses use only the first 8 bits to identify the
network part of the address
• Every network that uses a Class A IP address can have
assigned up to 2 to-the-power of 24 (224) (minus 2), or
16,777,214, possible IP addresses to devices that are attached
to its network
Network Layer 23
• The first 2 bits of a Class B address are always 10
(one and zero).
• example of a Class B IP address is 151.10.13.28
• The first two octets identify the network number
assigned by ARIN
• Class B IP addresses always have values ranging
from 128 to 191 in their first octet
• Every network that uses a Class B IP address can
have assigned up to 2 to-the-power of 16 (216) (minus
2 again!), or 65,534, possible IP addresses to devices
that are attached to its network
Network Layer 24
• The first 3 bits of a Class C address are always 110
(one, one and zero).
• An example of a Class C IP address is 201.110.213.28
• The first three octets identify the network number
• Class C IP addresses always have values ranging from
192 to 223 in their first octet.
• All Class C IP addresses use the first 24 bits to identify
the network part of the address
• Every network that uses a Class C IP address can have
assigned up to 28 (minus 2), or 254, possible IP
addresses to devices that are attached to its network
Network Layer 25
Network Layer 26
IP reserved Addresses
• If your computer wanted to communicate with all of the devices
on a network, it would be quite unmanageable to write out the IP
address for each device
• An IP address that ends with binary 0s in all host bits is
reserved for the network address (sometimes called the wire
address)
• Therefore, as a Class A network example, 113.0.0.0 is the IP
address of the network containing the host 113.1.2.3
• A router uses a network's IP address when it forwards data on
the Internet. As a Class B network example, the IP address
176.10.0.0 is a network address.
• If you wanted to send data to all of the devices on a network,
you would need to use a broadcast address
Network Layer 27
• Broadcast IP addresses end with binary 1s in the
entire host part of the address (the host field)
• For the network in the example (176.10.0.0)
• where the last 16 bits make up the host field (or host
part of the address), the broadcast that would be sent
out to all devices on that network would include a
destination address of 176.10.255.255 (since 255 is
the decimal value of an octet containing 11111111).
• When you send a broadcast packet on a network, all
devices on the network notice it
Network Layer 28
Subnets
• Network administrators sometimes need to divide
networks, especially large ones, into smaller
networks
• These smaller divisions are called subnetworks and
provide addressing flexibility. Most of the time
subnetworks are simply referred to as subnets
• each subnet address is unique.
• Subnet addresses include the Class A, Class B, or
Class C network portion, plus a subnet field and a
host field
Network Layer 29
Network Layer 30
• The subnet field and the host field are created from
the original host portion for the entire network
• To create a subnet address, a network administrator
borrows bits from the original host portion and
designates them as the subnet field.
• The minimum number of bits that can be borrowed is
2
Network Layer 31
Why subnets!
• A primary reason for using subnets is to reduce the
size of a broadcast domain
• When broadcast traffic begins to consume too much
of the available bandwidth, network administrators
may choose to reduce the size of the broadcast
domain.
Network Layer 32
Subnet Mask
• The subnet mask (formal term: extended network
prefix), is not an address, but determines which part
of an IP address is the network field and which part is
the host field
• A subnet mask is 32 bits long and has 4 octets, just
like an IP address.
• To determine the subnet mask for a particular
subnetwork IP address follow these steps
– Express the subnetwork IP address in binary form
– Replace the network and subnet portion of the address with
all 1s
– Replace the host portion of the address with all 0s
– As the last step convert the binary expression back to
dotted-decimal notation.Network Layer 33
• The term "operations" in mathematics refers to rules
that define how one number combines with other
numbers
• The basic Boolean operations are AND, OR, and
NOT.
Network Layer 34
Network Layer 35
• In order to route a data packet, the router must first
determine the destination network/subnet address by
performing a logical AND using the destination host's
IP address and the subnet mask
• The result will be the network/subnet address
• The router has received a packet for host
131.108.2.2 - it uses the AND operation to learn that
this packet should be routed to subnet 131.108.2.0
Network Layer 36
Subnet Mask (Cont.)
• The process used to apply the subnet mask
involves Boolean Algebra to filter out non-
matching bits to identify the network
address.
Network Layer 37
Boolean Algebra
• Boolean Algebra is a process that applies
binary logic to yield binary results.
• Working with subnet masks, you need only 4
basic principles of Boolean Algebra:
– 1 and 1 = 1
– 1 and 0 = 0
– 0 and 1 = 0
– 0 and 0 = 0
Network Layer 38
Boolean Algebra (Cont.)
• In another words, the only way you can get
a result of a 1 is to combine 1 & 1.
Everything else will end up as a 0.
• The process of combining binary values
with Boolean Algebra is called Anding.
Network Layer 39
Default Standard Subnet Masks
• There are default standard subnet masks
for Class A, B and C addresses:
Network Layer 40
A Trial Separation
• Subnet masks apply only to Class A, B or C
IP addresses.
• The subnet mask is like a filter that is
applied to a message’s destination IP
address.
• Its objective is to determine if the local
network is the destination network.
Network Layer 41
A Trial Separation (Cont.)
• The subnet mask goes like this:
1. If a destination IP address is
206.175.162.21, we know that it is a Class
C address & that its binary equivalent is:
11001110.10101111.10100010.00010101
Network Layer 42
A Trial Separation (Cont.)
1. We also know that the default standard
Class C subnet mask is: 255.255.255.0 and
that its binary equivalent is:
11111111.11111111.11111111.00000000
Network Layer 43
A Trial Separation (Cont.)
Network Layer 44
A Trial Separation (Cont.)
1. The result is the IP address of the network
which in this case is the same as the local
network & means that the message is for
a node on the local network.
Network Layer 45
Subnetting Networks ID
• A 3-step example of how the default Class A
subnet mask is applied to a Class A address:
Network Layer 46
Subnetting Networks ID (Cont.)
• In the previous slide, the default Class A subnet
mask (255.0.0.0) is AND’d with the Class A
address (123.123.123.001) using Boolean Algebra,
which results in the Network ID (123.0.0.0) being
revealed.
• The default Class B subnet mask (255.255.0.0)
strips out the 16-bit network ID & the default
Class C subnet mask (255.255.255.0) strips out
the 24-bit network ID.
Network Layer 47
Subnetting, Subnet & Subnet Mask
Network Layer 49
Subnetting
• A network has its own unique address, such as
a Class B network with the address 172.20.0.0
which has all zeroes in the host portion of the
address.
• From the basic definitions of a Class B network
& the default Class B subnet mask, you know
that this network can be created as a single
network that contains 65,534 individual hosts.
Network Layer 50
Subnetting (Cont.)
• Through the use of subnetting, the network
from the previous slide can be logically
divided into subnets with fewer hosts on
each subnetwork.
• It does not improve the available shared
bandwidth only, but it cuts down on the
amount of broadcast traffic generated over
the entire network as well.
Network Layer 51
Subnetting (Cont.)
• The 2 primary benefits of subnetting are:
1. Fewer IP addresses, often as few as one, are
needed to provide addressing to a network &
subnetting.
2. Subnetting usually results in smaller routing
tables in routers beyond the local
internetwork.
Network Layer 52
Subnetting (Cont.)
• Example of subnetting: when the network
administrator divides the 172.20.0.0
network into 5 smaller networks –
172.20.1.0, 172.20.2.0, 172.20.3.0,
172.20.4.0 & 172.20.5.0 – the outside world
stills sees the network as 172.20.0.0, but the
internal routers now break the network
addressing into the 5 smaller subnetworks.
Network Layer 53
Subnetting (Cont.)
• In the example, only a single IP address is
used to reference the network & instead of
5 network addresses, only one network
reference is included in the routing tables
of routers on other networks.
Network Layer 54
Borrowing Bits to Grow a Subnet
• The key concept in subnetting is borrowing
bits from the host portion of the network to
create a subnetwork.
• Rules govern this borrowing, ensuring that
some bits are left for a Host ID.
• The rules require that two bits remain
available to use for the Host ID& that all of
the subnet bits cannot be all 1s or 0s at the
same time.
Network Layer 55
Borrowing Bits to Grow a Subnet
(Cont.)
• For each IP address class, only a certain
number of bits can be borrowed from the
host portion for use in the subnet mask.
Network Layer 56
Borrowing Bits to Grow a Subnet
(Cont.)
Bits Available for Creating Subnets
A 24 22
B 16 14
C 8 6
Network Layer 57
Subnetting a Class A Network
• The default subnet mask for a class A
network is 255.0.0.0 which allows for more
than 16,000,000 hosts on a single network.
• The default subnet mask uses only 8 bits to
identify the network, leaving 24 bits for
host addressing .
Network Layer 58
Subnetting a Class A Network (Cont.)
• To subnet a Class A network, you need to borrow
a sufficient number of bits from the 24-bit host
portion of the mask to allow for the number of
subnets you plan to create, now & in the future.
• Example: To create 2 subnets with more than 4
millions hosts per subnet, you must borrow 2 bits
from the 2nd octet & use 10 masked (value equals
one) bits for the subnet mask
(11111111.11000000) or 255.192 in decimal.
Network Layer 59
Subnetting a Class A Network (Cont.)
Network Layer 60
Class A Subnet Masks (Cont.)
• A sample of subnet mask options available for Class A addresses.
Network Layer 61
Class A Subnet Masks (Cont.)
• All subnet masks contain 32 bits; no more,
no less.
• However a subnet mask cannot filter more
than 30 bits. This means 2 things:
– One, that there cannot be more than 30 ones
bits in the subnet mask.
– Two, that there must always be at least 2 bits
available for the Host ID.
Network Layer 62
Class A Subnet Masks (Cont.)
• The subnet mask with the highest value
(255.255.255.252) has a binary
representation of:
11111111.11111111.11111111.11111100
• The 2 zeroes in this subnet mask represent
the 2 positions set aside for the Host
address portion of the address.
Network Layer 63
Class A Subnet Masks (Cont.)
• Remember that the addresses with all ones
(broadcast address) & all zeroes (local
network) cannot be used as they have
special meanings.
Network Layer 64
Subnetting Class B & Class C
• The table on previous slide “Class A Subnet
Masks” is similar to the tables used for Class
B & Class C IP addresses & subnet masks.
• The only differences are that you have
fewer options (due to a fewer number of
bits available) & that you’re much more
likely to work with Class B & Class C
networks in real life.
Network Layer 65
Subnetting Class B & Class C (Cont.)
• A sample of the subnet masks available for Class B networks.
Network Layer 66
Subnetting Class B & Class C (Cont.)
• A list of the subnet masks available for Class C networks.
Network Layer 67
Knowing How to Calculate Subnets
Network Layer 68
Knowing How to Calculate Subnets
(Cont.)
Network Layer 69
Knowing How to Calculate Subnets
(Cont.)
Network Layer 70
Class C Subnets
• Knowing the relationships in this table will
significantly reduce the time you spend
calculating subnetting problems.
Network Layer 71
Class B Subnets
• To calculate the number of subnets & hosts
available from a Class B subnet mask, you
use the same host & subnet formulas
described for calculating Class C values.
• Using these formulas I have constructed a
table that contains the Class B subnet &
host values.
Network Layer 72
Class B Subnets (Cont.)
Network Layer 73
So How Does This Work?
• We ask our ISP for a Class C license.
• They give us the Class C bank of 206.15.143.0
• This gives us 1 Network (206.15.143.0) with
the potential for 254 node addresses
(206.15.143.1 to 206.15.143.254).
• But we have a LAN made up of 5 Networks
with the largest one serving 25 nodes.
• So we need to Subnet our 1 IP address...
Network Layer 74
So How Does This Work?
• To calculate the number of subnets
(networks) and/or nodes, we need to do
some math:
Network Layer 76
Break it down:
• Let’s go back to what portion is what:
We have a Class C address:
NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn
With a Subnet mask of:
11111111.11111111.11111111.00000000
Network Layer 77
Break it down:
• NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNnnnnn
Network Layer 78
What address is what?
• Which of our 254 addresses will be a Subnet (or
Network) address and which will be our node
addresses?
• Because we are using the first 3 bits for our subnet
mask, we can configure them into eight different ways
(binary form):
000 001
010 011
100 101
110 111
Network Layer 79
What address is what?
• We cannot use all “0”s or all “1”s
000 001
010 011
100 101
110 111
Network Layer 80
Network (Subnet) Addresses
• Remember our values:
128 64 32 16 8 4 2 1 Equals
Now our 3 bit configurations:
0 0 1 n n n n n 32
0 1 0 n n n n n 64
0 1 1 n n n n n 96
1 0 0 n n n n n 128
1 0 1 n n n n n 160
1 1 0 n n n n n 192
Network Layer 81
Network (Subnet) Addresses
0 0 1 n n n n n 32
0 1 0 n n n n n 64
0 1 1 n n n n n 96
1 0 0 n n n n n 128
1 0 1 n n n n n 160
1 1 0 n n n n n 192
Network Layer 83
Node Addresses
• The device assigned the first address will receive the
first number AFTER the network address shown before.
206.15.143.33 or 32+1
0 0 1 0 0 0 0 1
And the last address in the Network will look like this:
206.15.143.62
0 0 1 1 1 1 1 0
*Remember, we cannot use all “1”s, that is the broadcast address
(206.15.143.63)
Network Layer 84
Node Addresses
• The next network will start at 206.15.143.64
• The first IP address on this subnet network will
receive:
206.15.143.65
0 1 0 0 0 0 0 1
And the last address in the Network will receive:
206.15.143.94
0 1 0 1 1 1 1 0
*Remember, the broadcast address (206.15.143.95)
Network Layer 85
Can you figure out the rest?
• Network: Host Range
• 206.15.143.32 206.15.143.32 to 206.15.143.62
• 206.15.143.64 206.15.143.65 to 206.15.143.94
• 206.15.143.96
• 206.15.143.128 206.15.143.97 to 206.15.143.126
• 206.15.143.160 206.15.143.129 to 206.15.143.158
• 206.15.143.192
206.15.143.161 to 206.15.143.190
206.15.143.193 to 206.15.143.222
Network Layer 86
How the computer finds the
Network Address:
• 200.15.143.89 An address on the subnet
• 225.225.225.224 The new subnet mask
• When the computer does the Logical Bitwise AND
Operation it will come up with the following Network
Address (or Subnet Address):
11001000.00001111.10001111.01011001= 200.15.143.89
11111111.11111111.11111111.11100000 = 255.255.255.224
11001000.00001111.10001111.01000000 = 200.15.143.64 (Network)
This address falls on our 2nd Subnet (Network)
Network Layer 87
Review
• We have one class C license.
• We need to subnet that into 12 possible
networks.
• Each network needs a maximum of 10 nodes.
• How many bits do we need to take?
24-2=14
4 bits need to be taken from the node portion and
given to the network portion.
Network Layer 88
Review
• Will that leave enough bits for the node
portion? We need a maximum of 10 on
each network…
24-2=14
• If we take 4 away, that leaves us with 4.
That is enough for our individual networks
of 10 nodes each.
Network Layer 89
Review
• Our new subnet mask will look like this:
11111111.11111111.11111111.11110000
255.255.255.240 128+64+32+16= 240
• Our subnet, or network addresses will be:
206.15.143.16 206.15.143.32 206.15.143.48
206.15.143.64 206.15.143.80 206.15.143.96
206.15.143.112 206.15.143.128 206.15.143.144
206.15.143.160 206.15.143.176 206.15.143.192
206.15.143.208 206.15.143.224
Network Layer 90
VLSM
• VLSM – the process
of sub-netting a
subnet to fit your
needs
• Example:
– Subnet 10.1.0.0/16, 8
more bits are borrowed
again, to create 256
subnets with a /24 mask.
– Mask allows for 254 host
addresses per subnet
– Subnets range from:
10.1.0.0 / 24 to
10.1.255.0 / 24
VLSM
• Find the largest segment. Segment which need largest
number of hosts address.
• Do Subnetting to fulfill the requirement of largest segment.
• Assign the appropriate subnet mask for the largest segment.
• For second largest segments, take one of these newly
created subnets and apply a different, more appropriate,
subnet mask to it.
• Assign the appropriate subnet mask for the second largest
segment.
• Repeat this process until the last network.
VLSM
• Step 1- Oder Segments from largest to
smallest
Subnet Segment Hosts
1 Computer Science 74
2 EE 52
3 Physics 28
4 Wan link 1 2
5 Wan link 2 2
6 Wan link 3 2
• Step 2: largest segment needs 74 host
addresses. /25 provide us two subnets with
126 hosts in each subnet. 192.168.1.0/25
Subnet Subnet 1 Subnet 2
Network ID 192.168.1.0 192.168.1.128
We cannot use subnet 1 and subnet 2 ( address from 0 to 127 ) as they are already
assigned to Computer Science department. We can assign subnet 3 to EE department.
Segment EE
Requirement 52
CIDR /26
Network ID 192.168.1.128
Broadcast ID 192.168.1.191
• Step 4 :- Our next segment requires 28 hosts. From above subnetting we
have subnet 3 and subnet 4 available. Do subnetting for the requirement of
28 hosts.
• 192.168.1.0/27
Subnet Sub 1 Sub 2 Sub 3 Sub 4 Sub 5 Sub 6 Sub 7 Sub 8
Requirement 28
CIDR /27
Network ID 192.168.1.192
Broadcast ID 192.168.1.223
ICMP: Internet Control Message Protocol
A B C D E F
Physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
data data
A-to-B: E-to-F:
B-to-C: B-to-C:
IPv6 IPv6
IPv6 inside IPv6 inside
IPv4 IPv4
Network Layer 107
Graph abstraction
5
3
v w 5
2
u 2 1 z
3
1 2
Graph: G = (N,E)
x 1
y
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Notation:algorithm
Dijkstra’s
•• net
c(x,y):
topology, link from
link cost costsnode
known toy;all=nodes
x to ∞ if not direct neighbors
– accomplished via “link state broadcast”
• D(v): current value of cost of path from source to dest. v
– all nodes have same info
• p(v): predecessor node along path from source to v
• computes least cost paths from one node (‘source”) to all other nodes
• N': set offorwarding
– gives nodes whose least
table forcost
thatpath
nodedefinitively known
• iterative: after k iterations, know least cost path to k dest.’s
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
1 A A A A
1+e 2+e 0 0 2+e 2+e 0
D 0 0 B D 1+e 1 B D B D 1+e 1 B
0 0
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing
Network Layer 114
Distance Vector Algorithm (1)
Bellman-Ford Equation (dynamic programming)
Define
dx(y) := cost of least-cost path from x to y
Then
distributed:
• each node communicates only with directly-attached
neighbors
iterative:
• continues until no nodes exchange info.
• self-terminating: no “signal” to stop
asynchronous:
• nodes need not exchange info/iterate in lock step!
Network Layer 117
Distance Vector Routing Algorithm
distance from X to
= Y, via Z as next hop
DX(Y,Z)
Z
= c(X,Z) + minw{D (Y,w)}
X
2 7
Y Z
1
X
2 7
Y Z X Z
1 D (Y,Z) = c(X,Z) + minw {D (Y,w)}
= 7+1 = 8
X Y
D (Z,Y) = c(X,Y) + minw {D (Z,w)}
= 2+1 = 3
X
2 7
Y Z
1
X
2 7
No improvement
Y Z
1
2 8
X 3 7
2 7
Y Z
1
2 4
5 1
7 3
9 1
destination
E D
D (C,D) = c(E,D) + minw {D (C,w)}
= 2+2 = 4 C 6 9 4
E D
D (A,D) = c(E,D) + min {D (A,w)}
w D 4 11 2
= 2+3 = 5 loop!
E B
D (A,B) = c(E,B) + minw{D (A,w)}
= 8+6 = 14
loop!
Network Layer 127
Distance table gives routing table
A 1 14 5 A A,1
B 7 8 5 B D,5
destination
destination
C 6 9 4 C D,4
D 4 11 2 D D,4
algorithm
terminates
“good
news
travels
fast”
Y Y Y
algorithm
continues
on!
algorithm
Y Y Y Y
terminates
administrative autonomy:
internet = network of networks
each network administrator may want to control routing in its own
network
C.b Gateways:
B.a
• perform inter-AS
A.a
b c routing amongst
a A.c a
C b themselves
a B • perform intra-AS
d c routers with other
A b
routers in their
AS
network layer
inter-AS, intra-AS link layer
routing in physical layer
gateway A.c
– link-state
• OSPF (Open Shortest Path First)
– distance vector
• RIP (Routing Information Protocol) [RFC 1058] [RFC 1723]
• BGP (Border Gateway Protocol) (inter-AS routing)
routed routed
Transprt Transprt
(UDP) (UDP)
network forwarding forwarding network
(IP) table table (IP)
link link
physical physical
Network Layer 143
RIP Table example (continued)
Router: giroflee.eurocom.fr
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
127.0.0.1 127.0.0.1 UH 0 26492 lo0
192.168.2. 192.168.2.5 U 2 13 fa0
193.55.114. 193.55.114.6 U 3 58503 le0
192.168.3. 192.168.3.5 U 2 25 qaa0
224.0.0.0 193.55.114.6 U 3 0 le0
default 193.55.114.129 UG 0 143454
R4
R5 BGP
R3 AS3
(OSPF intra-AS
AS1 AS2 routing)
(RIP intra-AS (OSPF
routing) BGP intra-AS
routing)
R1 R2
legend: provider
B network
X
W A
customer
C network:
legend: provider
B network
X
W A
customer
C network:
R3 R4 R3 R4
(a) (b)
B
c
D
F E
B B
c c
D D
F E F E
G G
(a) Broadcast initiated at A (b) Broadcast initiated at D
S: source LEGEND
R1 2
1 R4 router with attached
group member
R2 5
router with no attached
3 4
R5 group member
R3 6 i link used for forwarding,
R6 R7 i indicates order link
added by algorithm
Network Layer 163
Reverse Path Forwarding
LEGEND
Dense: Sparse:
group members densely # networks with group
packed, in “close” members small wrt #
proximity. interconnected networks
bandwidth more plentiful group members “widely
dispersed”
bandwidth not plentiful
Dense Sparse:
• group membership by • no membership until routers
routers assumed until explicitly join
routers explicitly prune • receiver- driven construction
• data-driven construction on of mcast tree (e.g., center-
mcast tree (e.g., RPF) based)
• bandwidth and non-group- • bandwidth and non-group-
router processing profligate router processing
conservative
lo
• transport protocols run in end data link
gi
ca
physical
systems
l
network
en
data link
d-
– send side: breaks app physical network
en
data link
d
messages into segments, physical
tr
an
network
passes to network layer
s
data link
po
physical
rt
– rcv side: reassembles
segments into messages, application
transport
passes to app layer network
data link
• more than one transport protocol physical
available to apps
– Internet: TCP and UDP
Network Network
Layer Layer
– cumulative ACK
Host sends
Q: how receiver handles out- another Seq=1
043, A
of-order segments 500 bytes CK=79
, data
– A: TCP spec doesn’t
a
say, - up to n o dat
K =1 544,
implementor C time
79, A
Seq=
• speed-matching service:
matching the send rate to
the receiving app’s drain
rate
app process may be slow
at reading from buffer
indicates congestion 12
13
X
• Option 1: time-out
14
15
16
can be long! 11
11
11
• Option 2: duplicate
11
ACKs
Sender Receiver
– How many? At least 3.
Network Layer 207
Fast Retransmit
• Wait for a timeout is quite long
• Immediately retransmits after 3 dupACKs
without waiting for timeout
• Adjusts ssthresh
ssthresh W/2
• Enter Slow Start
W=1
Flow Characteristics
Flow Classes
Scheduling
Traffic Shaping
Resource Reservation
Admission Control
Signaling
Flow Specification
Admission
Service Classes
RSVP
Network Layer 232
Integrated Services is a flow-based
QoS model designed for IP.
An Alternative to
Integrated Services