Wk5 1234
Wk5 1234
COMPUTER NETWORKS
The IP addresses
are
unique.
4
ADDRESS SPACE
…………..
addr1 …………..
addr15
addr2 ………….. …………..
…………..
addr41 addr226
addr31
………….. …………..
5
ADDRESS SPACE RULE
…………..
…………..
The addr15
addr2 ………….. in a protocol
address space
…………..
That uses N-bits to define an
…………..
Address is: addr226
addr41
addr31 2 N
………….. …………..
6
IPV4 ADDRESS SPACE
7
BINARY NOTATION
192 . 168 . 0 . 1
8
+R
A Request for Comments (RFC) is a publication from the Internet Society
(ISOC) and its associated bodies, most prominently the Internet
Engineering Task Force (IETF), the principal technical development and
standards-setting bodies for the Internet.
CLASSFUL
ADDRESSING
12
OCCUPATION OF THE ADDRESS SPACE
A, B, C, D, & E
13
FINDING THE CLASS IN BINARY NOTATION
14
FINDING THE ADDRESS CLASS
15
EXAMPLE
17
FINDING THE CLASS IN DECIMAL NOTATION
00000000 🡪 01111111 (127)
10000000 (128) 🡪 10111111 (191)
11000000 (192) 🡪 11011111 (223)
18
EXAMPLE
Find the class of the following addresses
158.223.1.108
227.13.14.88
•158.223.1.108
1st byte = 158 (128<158<191) class B
•227.13.14.88
1st byte = 227 (224<227<239) class D
19
20
PORT NUMBER
Default Port:1-1024
Ping: 7
DHCP: 68
✔ 158.128.1.108:25
✔ the for octet before colon is the IP address
✔ The number of colon (25) is the port
number
✔ 16-bit integer, so 65535.
NETID AND HOSTID
21
Router
BLOCKS IN CLASS A
23
Millions of class A addresses
are wasted.
24
BLOCKS IN CLASS B
25
Many class B addresses
are wasted.
26
BLOCKS IN CLASS C
The number of addresses in
a class C block
is smaller than
the needs of most organizations.
28
Class D addresses
are used for multicasting;
there is only
one block in this class.
29
Class E addresses are reserved
for special purposes;
most of the block is wasted.
30
Network Addresses
32
33
MASK
34
AND operation
35
The network address is the
beginning address of each block.
It can be found by applying
the default mask to
any of the addresses in the block
(including itself).
It retains the netid of the block
and sets the hostid to zero.
36
37
Default Mask
38
SUBNETTING
39
40
Note
41
Figure 5-5
Default mask and subnet mask
72 =01001000
192 =11000000
01000000=64
42
Finding the Subnet Address
43
Straight Method
In the straight method, we use binary
notation for both the address and the
mask and then apply the AND operation
to find the subnet address.
44
EXAMPLE
45
Solution
47
The number of subnets must be
a power of 2.
48
EXAMPLE
Solution
50
Solution (Continued)
51
EXAMPLE
52
EXAMPLE
A company is granted the site address
181.56.0.0 (class B). The company needs
1000 subnets. Design the subnets.
Solution
53
Solution (Continued)
57
Variable-length blocks
58
Variable-Length Subnet Masks
• Variable-Length Subnet Masks –VLSM
59
Variable-Length Subnet Masks
60
Variable-Length Subnet Masks
61
o For the left LAN, 150 addresses are needed;
o rounding up to the next power of 2 gives 256.
o Because 28 = 256, 8 host bits are needed.
o For the other two LANs, 100 addresses are needed;
o rounding up to the next power of 2 gives 128.
o Because 27 = 128, 7 host bits are needed for each LAN.
o The WANs require 2 host bits each.
62
o Because at most 8 host bits are needed, the 10.5.16.0/20
address can be further subnetted into sixteen /24 subnets
(leaving 8 host bits)
63
64
65
Report Submission
150 addresses
100 addresses
150 addresses
RU IP Block
ROUTING
• The main function of the network layer is ROUTING PACKETS from
the source machine to the destination machine.
• In most networks, packets will require multiple hops to make
the journey.
– The routing algorithm is that part of the network layer
software responsible for deciding which output line an
incoming packet should be transmitted on.
• ROUTING ALGORITHMS can be grouped into two major classes:
– NONADAPTIVE AND
– ADAPTIVE.
68 of 12
NONADAPTIVE ROUTING
• NONADAPTIVE algorithms do not base their routing decisions on
any measurements or estimates of the current topology and
traffic.
• Instead, the choice of the route to use to get from I to J (for all
I and J) is computed in advance, offline, and downloaded to
the routers when the network is booted.
• This procedure is sometimes called static routing
ADAPTIVE ROUTING
• ADAPTIVE algorithms, in contrast, change their routing decisions
to reflect changes in the topology, and sometimes changes in
the traffic as well.
• These dynamic routing algorithms differ in :
– where they get their information (e.g., locally, from
adjacent routers, or from all routers),
– when they change the routes (e.g., when the topology
changes, or every ΔT seconds as the load changes), and
– what metric is used for optimization (e.g., distance,
number of hops, or estimated transit time
70 of 12
OPTIMALITY PRINCIPLE
• It states that if router J is on the optimal path from router I to
router K then the optimal path from J to K also falls along the
same route
THE SHORTEST PATH ALGORITHM
S
DISTANCE VECTOR ROUTING
• A distance vector routing algorithm operates by having each
router maintain a table (i.e., a vector) giving the best known
distance to each destination and which link to use to get
there.
• These tables are updated by exchanging information with the
neighbors. Eventually, every router knows the best link to
reach each destination
• As an example, assume that delay is used as a metric and that
the router knows the delay to each of its neighbors
G: Send via A -18ms
LINK STATE ROUTING
ARP and RARP
• Address Resolution Protocol (32bit IP to 48 bit MAC)
• Reverse Address Resolution Protocol (48 bit MAC to 32 bit IP)