Unit 2
Unit 2
IPV4 Addressing
ARCHITECTURE
IPv4 ADDRESSES
Solution
We replace each group of 8 bits with its equivalent
decimal number and add dots for separation.
Example 2
Solution
We replace each decimal number with its binary
equivalent.
Example 3
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
Figure Finding the classes in binary and dotted-decimal notation
Yellow-Network ID
White-host ID
Example 4
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Table Number of blocks and block size in classfull IPv4 addressing
be used in a network
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 00100000
or
205.16.37.32.
This is actually the block shown in Figure
Example 19.7
The last address in the block can be found by setting the rightmost
32 − n bits to 1s.
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
This is actually the block shown in Figure
Example 8
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example 9
Another way to find the first address, the last address, and
the number of addresses is to represent the mask as a 32-
bit binary number. This is particularly useful when we
are writing a program to find these pieces of information.
In Example 6 the /28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).
Find
a. The first address
b. The last address
c. The number of addresses.
Example 9 (continued)
Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.
Example 9 (continued)
Solution
Figure 9 shows the situation.
Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each
host. The prefix length is then 32 − 8 = 24. The addresses
are
Example 10 (continued) VLSM
Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each
host. The prefix length is then 32 − 7 = 25. The addresses
are
Example 10 (continued) VLSM
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26. The addresses are
Bridges
Two-Layer Switches
Routers
Three-Layer Switches
Gateways
Figure Five categories of connecting devices
Figure A repeater connecting two segments of a LAN
Loop problem:
•Redundancy can create loops in the system which is undesirable.
•Same frame may be forwarded to the bridges multiple times due to looping
Figure A learning bridge and the process of learning
Figure Loop problem in a learning bridge
Figure A system of connected LANs and its graph representation
Spanning Tree
Algorithm:
•Select the root bridge which has smallest bridge ID(unique serial number).each
bridge broadcasts its Bridge Id so all bridges know the ID of the other.
•Find the shortest path from root bridge to every other bridge by examining the
total cost.
• combination of shortest paths create shortest tree
Figure Finding the shortest paths and the spanning
tree in a system of bridges
Figure Forwarding and blocking ports after using spanning
tree algorithm
Issues to be considered when connecting different LAN using bridges
•Frame format
•Maximum data size
•Data rate
•Bit order
•Security
•Multimedia support
Ex: bridge
Figure Routers connecting independent LANs and WANs
Routers
•Three layer device that routes the packets based on logical addressing
•Connects LAN and WAN
•It has a routing table to make decisions about the route.
•Routing tables are dynamic and updates using routing protocols
(draw a scenario with routers and write the routing table as example)