9/19/04
Protocol Layers
-protocol software is designed by layers
-each layer solves a different problem
-one software module for each layer
-the set of modules is called a “protocol stack”
-each layer will have a different header
|
header 1 |
header 2 |
header 3 |
… |
data |
-the packet headers will be read by each layer
host1 ------data------ host2
layer4 ….header4…. layer4
layer3 ….header3…. layer3
layer2 ….header2…. layer2
layer1 ….header1…. layer1
-layer N in host1 communicates with layer N in host2 using the header N
Internetworking
-the Internet is a collection of networks that use different networking hardware
+ Ethernet + Token Ring + FDDI
+ RS 232 + SNA + ATM, etc
-it is not possible (economically and logistically) to have a single kind of network hardware. No single technology is the best for all the needs.
-heterogeneity is inevitable
-solution:
Have a layer of software that will make the network look homogeneous. This layer is the IP layer.
-Internet layers:
Application – HTTP, FTP, TELNET, etc
Transport - UDP/TCP
Internet - IP
Network \____ eg: Ethernet, RS232, Token Ring, ATM, etc
Physical /
|
Host 1 |
|
Router1 |
|
|
Router 2 |
|
|
App |
|
Application |
|
Application |
||
|
Trans |
|
Trans |
|
|
Trans |
|
|
Int |
|
Internet |
|
|
Internet |
|
|
Net |
|
Net |
Net |
|
Net |
Net |
|
Phys |
|
Phys |
Phys |
|
Phys |
Phys |
iphdr and data stays the same in host1, router1, router2, host2 hardware hdr (ether hdr and RS232 hdr)
changes depending on the network
Implications:
-there is an RFC that tells you how to send IP packets on Ethernet, on Ethernet, there is one for ip on Token Ring, one for ip on RS232 and for every network hardware known
-RFC – Request For Comments
-the internet layer, transport, layer, and application layer implementation are the same independently of the network hardware
-the internet is formed by
host4 host5
XXX XXX
host1 host2 | |
XXX XXX XXXXXXXXXXXXXXXXXXXX FDDI1
|_______|_______ | |
| host3 | |______ Internet
XXX----- XXX XXX Router2
Router1 | | |
| | |
--------------------
| Token Ring |
--------------------
Networks are also represented by clouds
-a router has a different interface for every network it connects
-a router will have a different IP address for each network interface
-a router can connect networks that have different technologies
Internet Goal:
-to hide heterogeneity to the user applications
Layers:
Network Interface and Physical are network hardware dependent
Internet Protocol (IP) - Layer 3
-Defines
-IP addressing
A router will have a different IP address fro each interface
IP address
-2 parts
- prefix – identifies network
- suffix – identifies a host
-a global authority assigns the unique prefixes to the networks
-a local administrator assigns a unique suffix to a host
128.10.0.0
– prefix (network part) – given by global authority
- suffix (host part) – given by a local authority
9/21/04
Classes of IP addresses
class A -
0|1 7|8 31|
0| Network | host |
class B –
0|1 15|16 31|
1|0 Net | host |
class C
0|1|2|3 23|24 31|
1|1|0| Net | host |
class D
0|1|2|3| 31|
1|1|1|0| Multicast addresses |
class E
0|1|2|3|4| 31|
1|1|1|1|0| reserved for future use |
|
Class |
#Prefix bits |
#Max nets |
#Suffix bits |
Max hosts |
|
A |
7 |
2^7=128 |
24 |
2^34 = 16M |
|
B |
14 |
2^14=16384 |
16 |
2^16 = 64K |
|
C |
31 |
2^21=2M |
8 |
256 |
The maximum number of hosts is given by the class of the address
Examples (Dotted decimal notation):
129.52.6.0
1000 0001 0011 0100 0000 0110 0000 0000
Class B address
192.5.48.3
1100 0000 - class C
10.2.0.3
0000 1010 – class A
The network prefix is used in the network backbone to route packets to the corporations, universities, and ISPs that have that network prefix
(Berkeley-128.210.0.0?)------{INTERNET}--------(Purdue-128.10.0.0)
|
X(access point)
|
------(Microsoft-192.5.48.0)
The network prefix is given by a global authority (IANA) and the routers in the internet are configured to send packets for that network access point.
Send IP packet from Berkeley computer (128.210.5.8) to 128.10.5.8
-go through access point to Internet to access point to Purdue network to Purdue computer
The suffix in the IP address will be used to route the packet within the corporation, university, or ISP
INTERNET}----X---(Purdue-128.10.0.0)
| |
| |
[Router-128.10.3.0] [Router-128.10.4.0]
-The subnet mask tells us how many bits correspond to the subnet.
1-net/subnet 0-host
Example:
IP net 128.10.0.0
Subnet mask 255.255.255.0
XXX.XXX|XXX|XXX
Network|sub|host
This subnet tells us that we have 256 subnets and 256 hosts per subnet. This is a typical class D partition. Another assignment could be
Subnet mask 255.255.254.0
128 subnets: [1111 111][0
512 hosts subnet: 0000 0000]
-Subnetting is a decision of the network administrator. They will decide the subnet mask
-The routing within the network (128.10.0.0) will be done according to the subnet number
-The routers and hosts withing the network should be aware of the subnet mask to determine
Obtaining subnet number from an IP address:
ipaddr & subnetmask = subnet number
128.10.5.11 & 255.255.255.0 = 128.10.5.0 – subnet number
Host number:
ipaddr – subnet number
128.10.5.11 – 128.10.5.0 = 0.0.0.11 – host number
Routing Algorithms
Each router has a routing table that tells what is the next hop depending on the subnet/net destination
i1 i2 3.3 5.20
(128.10.10.0)---(R1)---(128.10.3.0)---(R2)------
| | |
| | |
[128.10.10.11] | |
(128.10.5.0) (128.10.6.0)—[6.23]
|
(R3)
|
{INTERNET}
Subnet Mask Next hop
128.10.3.0 255.255.255.0 deliver directly using interface
128.10.5.0 255.255.255.0 R2 (128.10.3.2)
128.10.6.0 255.255.255.0 R2 (128.10.3.2)
128.10.10.0 255.255.255.0 deliver directly using interface1 (i1)
Default R2 (128.10.3.2)