0% found this document useful (0 votes)
54 views

Wk5 1234

The document discusses computer networks and IP addressing. It covers topics such as what an IP address is, IP address classes (A, B, C, D, E), subnetting, variable length subnet masking, and routing. Examples are provided to illustrate how to determine the class and subnet of IP addresses in both binary and decimal notation.

Uploaded by

Hasibul Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Wk5 1234

The document discusses computer networks and IP addressing. It covers topics such as what an IP address is, IP address classes (A, B, C, D, E), subnetting, variable length subnet masking, and routing. Examples are provided to illustrate how to determine the class and subnet of IP addresses in both binary and decimal notation.

Uploaded by

Hasibul Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

CSE3151

COMPUTER NETWORKS

DR. ASIF ZAMAN


ASSOCIATE PROFESSOR, CSE, RU
COURSE CONTENTS
MAIN STORY
WHAT IS AN IP ADDRESS?
An IP address is a
32-bit
address.

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

The address space of IPv4 is


232
or
4,294,967,296.

7
BINARY NOTATION

11000000 10101000 00000000 00000001

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

In classful addressing the address space is


divided into 5 classes:

A, B, C, D, & E

13
FINDING THE CLASS IN BINARY NOTATION

14
FINDING THE ADDRESS CLASS

15
EXAMPLE

Show that Class A has


31
2 = 2,147,483,648 addresses

01000000 10101000 00000000 00000001


16
EXAMPLE

Find the class of the following IP addresses


00000001 00001011 00001011 11101111
11000001 00001011 00001011 11101111

•00000001 00001011 00001011 11101111


1st is 0, hence it is Class A
•11000001 00001011 00001011 11101111
1st and 2nd bits are 1, and 3rd bit is 0 hence, Class C

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

The network address is the first address.

The network address defines the network to the


rest of the Internet.
Given the network address, we can find the
class of the address, the block, and the range of
the addresses in the block
31
In classful addressing,
the network address
(the first address in the block)
is the one that is assigned
to the organization.

32
33

MASK

• A mask is a 32-bit binary number.


• The mask is ANDeD with IP address to get
• The block address (Network address)
• Mask And IP address = Block Address
Masking concept

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

• Class A default mask is 255.0.0.0


• Class B default mask is 255.255.0.0
• Class C Default mask 255.255.255.0
Subnetting
and
Classless Addressing

38
SUBNETTING

39
40

Note

• Subnetting is done by borrowing bits from


the host part and add them the network
part
ADDRESSES IN A NETWORK WITH
AND WITHOUT SUBNETTING

41
Figure 5-5
Default mask and subnet mask

72 =01001000
192 =11000000
01000000=64

42
Finding the Subnet Address

Given an IP address, we can find the


subnet address the same way we found the
network address. We apply the mask to the
address. We can do this in two ways:
straight or short-cut.

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

What is the subnetwork address if the


destination address is 200.45.34.56 and the
subnet mask is 255.255.240.0?

45
Solution

11001000 00101101 00100010 00111000


11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000

The subnetwork address is 200.45.32.0.


46
COMPARISON OF A DEFAULT MASK AND
A SUBNET MASK

47
The number of subnets must be
a power of 2.

48
EXAMPLE

A company is granted the site address


201.70.64.0 (class C). The company needs
six subnets. Design the subnets.

Solution

The number of 1s in the default


mask is 24 (class C).
49
Solution (Continued)

• The company needs six subnets.


• This number 6 is not a power of 2.
• The next number that is a power of 2 is 8 (23).
• We need 3 more 1s in the subnet mask.
• The total number of 1s in the subnet mask is 27 (24 +
3).
• The total number of 0s is 5 (32 - 27). The mask is

50
Solution (Continued)

11111111 11111111 11111111 11100000


or
255.255.255.224
The number of subnets is 8.
The number of addresses in each subnet is 25 (5 is the
number of 0s) or 32.

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

The number of 1s in the default mask is 16


(class B).

53
Solution (Continued)

The company needs 1000 subnets. This


number is not a power of 2. The next number
10
that is a power of 2 is 1024 (2 ). We need 10
more 1s in the subnet mask.
The total number of 1s in the subnet mask is
26 (16 + 10).
The total number of 0s is 6 (32 − 26).
54
The mask is

11111111 11111111 11111111 11000000


or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26
(6 is the number of 0s) or 64.
See next slide
55
56
VARIABLE-LENGTH SUBNETTING

57
Variable-length blocks

58
Variable-Length Subnet Masks
• Variable-Length Subnet Masks –VLSM

59
Variable-Length Subnet Masks

60
Variable-Length Subnet Masks

o If you use any addresses from a subnet, that


subnet should not be further subnetted.

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

• One way of measuring path length is the number of hops.


Using this metric, the paths ABC and ABE in Fig. 5-7 are equally
long.
• Another metric is the geographic distance in kilometers, in
which case ABC is clearly much longer than ABE.
• Dijkstra
FLOODING
• When a routing algorithm is implemented, each router must
make decisions based on local knowledge, not the complete
picture of the network.
• A simple local technique is flooding, in which every incoming
packet is sent out on every outgoing line except the one it
arrived
D

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)

You might also like