Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

Part1 IP Subnetting

Subnetting Overview
1. Why subnetting?
If IPv4 addresses are only classified by class (A, B, C), it will cause a lot of waste or insufficient
use. Divide, divide a part into the network number, you can divide the network of various types
and sizes.

2. IPv4 subnetting and aggregation


In order to solve the shortcomings of IPv4 and improve the flexibility of network division, two
very important technologies were born, that is, VLSM (variable-length subnet mask) and CIDR
(classless inter-domain routing). The network evolves into a more efficient and practical classless
network.

CIDR and VLSM


1. Classful network; and Classless networks, SuperNetting and Subnets
① Classful network: It refers to the class A, B, and C IP addresses that can be attributed to, using
the standard default subnet mask.
② Classless network: Compared with classless network, the mask of the IP address of classless
network is variable. On the basis of class-based network, some host ids are taken as subnet ids.
③ SuperNetting: to combine multiple small networks into a large network, called SuperNetting,
also can be said that the length of the subnet mask is less than the corresponding class network
called super network.
④ Subnet: The Subnet whose mask length is longer than the corresponding class-based network is
called a Subnet

2. CIDR Classless Inter-Domain Routing


CIDR (Classless Inter-Domain Routing) essentially eliminates the traditional concept of class A,
class B and class C addresses and dividing subnets, and aggregates multiple address blocks
together to generate a larger network , thus including more hosts.
CIDR uses a variable network ID of 8-30 bits (the maximum usable can only be 30 bits, that is, 2
bits are reserved for the host bit), instead of the fixed 8, 16 and 24 bits used for A, B, and C
network IDs.
①the first thing to confirm is that this is a class C network address
②The first three bytes are all 255, and they are all 1 when converted into binary, that is,
11111111.11111111.11111111, that is, 24-bit 1.
③The next byte is 192, which is converted into binary to 11000000, that is, 1 occupies 2 bits.
④The subnet mask occupies a total of 26 bits of 1, so it is represented by CIDR as /26.
⑤If the network address is 192.168.10.0, plus CIDR, it is finally expressed as 192.168.10.0/26.

3. VLSM variable length subnet mask


VLSM (Variable Length Subnet Mask) specifies the ability to include multiple subnet masks in a
class (A, B, C) network, and the re-subnetting of a subnet Ability.
Each IP address contains two parts: the network number and the host number. In a classful
network, a 32-bit IP address is divided into 4 segments, each segment is represented by 8 bits. This
makes it necessary to prefix the network number with 8, 16 or 24 bits. When the network number
is 24 bits, the host number is only 8 bits, that is to say, the smallest address block that can be
allocated is 256 (2^8=256, and the actual host address that can be allocated must be subtracted by
two, One is the network address, one is the broadcast address, and finally 254), which is not
enough for most businesses.

subnet mask:
1. The concept and function of the subnet mask:
①The subnet mask is also called the network mask or the address mask, which must be used
together with the IP address.
②You can identify the relationship between a host subnet and other subnets only using the subnet
mask to ensure that the network works properly.
③Subnet Mask and IP address Perform the collation operation to separate the network address and
host address in the IP address. This operation is used to determine whether the IP address is on the
local network or the remote network.
④The subnet mask is also used to further divide the network into a number of subnets to avoid too
many hosts and congestion or too little IP waste.

2. Composition of the subnet mask


① Like an IP address, a subnet mask is an address consisting of 32 bits of binary digits.
② The subnet mask 32-bit corresponds to the IP address 32-bit. If the IP address is a network
address, the subnet mask is 1; otherwise, the subnet mask is 0.

According to the rules, can you give an subnet mask example?


for example: 11111111.11111111.11111111.00000000

3. Indicates the subnet mask


①Dotted decimal notation
Binary is converted to decimal, and every eight bits are separated by periods

The subnet mask binary 11111111.11111111.11111111.00000000, can you give its subnet mask?

The subnet mask binary 11111111.11111111.11111111.00000000, expressed as 255.255.255.0

②CIDR slash notation


IP address/n
Example1: 192.168.1.100/24
subnet mask is expressed as 255.255.255.0
binary representation:11111111.11111111.11111111.00000000
172.16.198.12/20,, can you give its subnet mask and binary representation?
subnet mask :255.255.240.0
binary representation:11111111.11111111.11110000.00000000
You can see that there are 24 1's in example 1, 20 1's in example 2, so that's where n comes from.
ISP often uses this method to assign IP addresses to customers.

Note:n is a number from 1 to 32, indicating the length of the network ID in the subnet mask. The
number of hosts in the subnet is determined by the number of n =2^(32-n)-2 (reason for -2: When
all the host bits are 0, it indicates the network address of the local network, and when all the host
bits are 1, it indicates the broadcast address of the local network, which are two special addresses).

Subnetting method
1. The basic idea of VLSM subnet division
Use the leftmost bits of the host bits of the existing network segment as subnet bits to divide
multiple subnets.
①Borrow the "Network ID" part of the original classful network IPv4 address from the "Host ID"
part
②Change a part of the bits that originally belonged to the "host ID" part into a part of the
"network ID" (usually called "subnet ID").
③, the original "network ID" + "subnet ID" = new "network ID". The length of the "subnet ID"
determines the number of subnets that can be divided.
The following example diagram:

Division of equal-length subnets and variable-length subnets


Subnetting tasks include:
① Determine the length of the subnet mask.
② Determine the available address range of the host under the subnet (the first available IP and the
last available IP).
③ Determine the network address (the host bits are all 0) and the broadcast address (the host bits
are all 1), and cannot be assigned to the computer host.

Ⅰ. Equal-length subnet division


Equal-length subnetting is to divide a classful network into multiple networks equally, that is,
equally divided into multiple subnets, and all subnets have the same subnet mask.
1. Class C network subnetting example
① equally divided into two subnets
Divide the network 192.168.0.0 255.255.255.0 into 2 subnets, and write out the address
information of each subnet?
analyze:
The subnet mask of this network is /24, to be divided into 2 subnets, and 1 bit of the host bit
should be borrowed as the subnet bit.
Because the binary numbers 0 and 1 are arranged and combined by one bit, there are only these
two types, namely: 0 and 1, as shown in the following figure.
0 is the A subnet;1 is the B subnet
1 bit is borrowed from the host, so the subnet mask +1 bit is changed from 255.255.255.0 (/24) to
255.255.255.128 (/25)
Conclusion: Class C network is equally divided into 2 subnets, and the subnet mask can be
divided into 2 subnets by moving the subnet mask 1 bit to the right, that is, 2^1.

Final result:
Network address of subnet A: 192.168.0.0/25, available addresses (192.168.0.1 to 192.168.0.126),
broadcast address: 192.168.0.127.
Network address of subnet B: 192.168.0.128/25, available addresses (192.168.0.129 to
192.168.0.254), broadcast address: 192.168.0.255.

②equally divided into four subnets

Divide the network 192.168.0.0 255.255.255.0 into 4 subnets


Analysis: To divide into 4 subnets, you need to move the subnet mask two places to the right
In this way, the 1st and 2nd bits become network bits, which can be divided into 4 subnets
Because the binary numbers 0 and 1 are arranged and combined by two digits, there are only these
4 kinds, namely: 00, 01, 10, 11, as shown in the following figure.
00 is the A subnet
01 is the B subnet
10 is the C subnet
11 is the D subnet
2 bits are borrowed from the host, so the subnet mask +2 bits is changed from the original
255.255.255.0 (/24) to 255.255.255.192 (/26)

指导版本
Conclusion: Class C network is equally divided into 4 subnets, and the subnet mask can be
divided into 4 subnets by moving the subnet mask to the right by 2 bits, that is, 2^2.

Final result:
Network address of subnet A: 192.168.0.0/26, available addresses (192.168.0.1 to 192.168.0.62),
broadcast address: 192.168.0.63/26.
Network address of subnet B: 192.168.0.64/26, available addresses (192.168.65 to 192.168.0.126),
broadcast address: 192.168.0.127.
Network address of subnet C: 192.168.0.128/26, available addresses (192.168.129 to
192.168.0.190), broadcast address: 192.168.0.191.
Network address of subnet D: 192.168.0.192/26, available addresses (192.168.193/26 to
192.168.0.254), broadcast address: 192.168.0.255.

③Equally divided into eight subnets


Divide a class C network into 8 subnets, as shown in the figure below, the subnet mask needs to be
shifted 3 bits to the right.
In this way, 8 subnets can be divided, and the 1st, 2nd, and 3rd bits of the host bits become
network bits.
Q:
What is your conclusion? Can you give all the results?
Conclusion: Class C network is equally divided into 8 subnets, and the subnet mask can be
divided into 8 subnets by moving the subnet mask 3 bits to the right, that is, 2^3.
Final result:
Subnet mask: 255.255.255.224 (/27)
Network address of subnet A: 192.168.0.0/27, available addresses (192.168.0.1 to 192.168.0.30),
broadcast address: 192.168.0.31.
Network address of subnet B: 192.168.0.32/27, available addresses (192.168.33 to 192.168.0.62),
broadcast address: 192.168.0.63.
Network address of subnet C: 192.168.0.64/27, available address (192.168.65 ~ 192.168.0.94),
broadcast address: 192.168.0.95.
Network address of subnet D: 192.168.0.96/27, available addresses (192.168.97 ~192.168.0.126),
broadcast address: 192.168.0.127.
Network address of E subnet: 192.168.0.128/27, available address (192.168.129~192.168.0.158),
broadcast address: 192.168.0.159.
Network address of subnet F: 192.168.0.160/27, available address (192.168.161~192.168.0.190),
broadcast address: 192.168.0.191.
Network address of G subnet: 192.168.0.192/27, available address (192.168.193~192.168.0.222),
broadcast address: 192.168.0.223.
Network address of H subnet: 192.168.0.224/27, available address (192.168.225~192.168.0.254),
broadcast address: 192.168.0.255.

2. Example of subnetting a class B network


Divide 131.107.0.0/16 into 2 subnets and write out the first and last available IP addresses for each
subnet?
Analysis: To be divided into 2 subnets, it is necessary to borrow 1 bit of the host bit as the subnet
bit.
0 is the A subnet ;1 is the B subnet
1 bit is borrowed from the host, so the subnet mask +1 bit is changed from 255.255.0.0 (/16) to
255.255.128.0 (/17)
Conclusion: Class B network is equally divided into 2 subnets, and the subnet mask can be
divided into 2 subnets by moving the subnet mask 1 bit to the right, that is, 2^1.

Final result:
A subnet
Network address: 131.107.0.0/17,
Available addresses (131.107.0.1 ~ 131.107.127.254)
Broadcast address: 131.107.127.255

B subnet
Network address: 131.107.128.0/17
Available addresses (131.107.128.1 ~ 131.107.255.254)
Broadcast address: 131.107.255.255

3. Class A network subnetting example


Divide the class A network 42.0.0.0/8 into 4 subnets, and write out the first and last available IP
addresses of each subnet?
Analysis: To be divided into 4 subnets, it is necessary to borrow 2 bits of host bits as subnet bits
00 is the A subnet
01 is the B subnet
10 is the C subnet
11 is the D subnet

2 bits are borrowed from the host, so the subnet mask + 2 bits is changed from 255.0.0.0 (/8) to
255.192.0.0 (/10)
Conclusion: A class A network is equally divided into 4 subnets, and the subnet mask can be
divided into 4 subnets by moving the subnet mask to the right by 2 bits, that is, 2^2.

Final result:
Network address of subnet A: 42.0.0.0/10, available address (42.0.0.1 ~ 42.63.255.254), broadcast
address: 42.63.255.255
Network address of subnet B: 42.64.0.0/10, available address (42.64.0.1 ~ 42.127.255.254),
broadcast address: 42.127.255.255
Network address of subnet C: 42.128.0.0/10, available address (42.128.0.1 ~ 42.191.255.254),
broadcast address: 42.191.255.255
Network address of subnet D: 42.192.0.0/10, available addresses (42.192.0.1 ~ 42.255.255.254),
broadcast address: 42.255.255.255

Ⅱ. Variable length subnet division


VLSM specifies how to use different subnet masks for different subnets in a subnetted network.
This is very effective for the situation where different network segments within the network
require different sizes of subnets. This method of dividing subnets is called variable-length
subnetting.

1. Summary of variable-length subnet division


① variable length subnet division rules
If a subnet address block is (1/2)^n of the original network segment, the subnet mask is shifted to
the right by n bits on the basis of the original network segment, and the subnet masks are different
for unequal length subnets.

② the subnet mask of the point-to-point network


Each subnet is (1/2)×(1/2)×(1/2)×(1/2)×(1/2)×(1/2) of the original network, which is (1/2) ^6, the
subnet mask is shifted 6 bits to the right.
For example: 11111111.11111111.11111111.11111100 written as a decimal subnet mask is
255.255.255.252.

Principle part

1. IP Address

IP address (Internet Protocol Address), abbreviated as IP Address, is an address format that


uniformly addresses hosts on the Internet, also known as an Internet Protocol (IP Protocol)
address. It assigns a logical address to each network and each host on the Internet. Common IP
addresses are divided into two categories: IPv4 and IPv6.

The IP address corresponds to the third network layer of the OSI reference model. The router
working in the network layer judges whether it belongs to the same network segment according to
the destination IP and the source IP. If it is a different network segment, it forwards the data
packet.

2. Format of IP addresses

An IP address (IPv4) consists of a 32-bit binary number, divided into 4 segments (4 bytes), each
segment is an 8-bit binary number (1 byte). Each segment of 8-bit binary is separated by
punctuation marks "."

Since the binary number is too long, in order to facilitate memory and identification, each segment
of 8-bit binary number is converted into decimal, and the size is 0 to 255. This representation of IP
addresses is called "dotted decimal notation". The IP address is represented as: xxx.xxx.xxx.xxx

3. Components of an IP Address

IP address = network address + host address


For example:

192.168.1.100
Network part Host part

The IP address of a computer consists of two parts. One part is the network identification, the
other part is the host identification. The computer network part in the same network segment is the
same, but the host part is different. Routers connect different network segments and are
responsible for data forwarding between different network segments. While switches connect
computers on the same network segment. By setting the network address and the host address, it is
ensured that the IP addresses of each host will not overlap each other in the entire network, that is,
the IP address is unique.

4. Classification of IP address

IP addresses are divided into five categories: A B C D and E. Among them, A B and C are
commonly used IP addresses, and categories D and E are special addresses.
a. Class A Address

ⅰ The first byte of a class A address is the network address (the highest bit is fixed at 0), and the
other 3 bytes are the host address.
ⅱ Class A address range: 1.0.0.0 - 126.255.255.255, with 0 and 127 as special addresses.
ⅲ The default subnet mask for a class A network is 255.0.0.0, which can also be written as /8.
ⅳ The maximum number of hosts in a class A network is 256×256×256-2=16777214 (minus 1
network address with 0 host bits and 1 broadcast address).

In a computer network, the address whose host ID is all 0 is the network address, and the address
whose host ID is all 1 is the broadcast address. These two addresses cannot be assigned to the
host.

b. Class B Address

ⅰ The first byte (the highest bit is fixed at 10) and the second byte of the class B address are the
network address, and the other two bytes are the host address.
ⅱ Class B address range: 128.0.0.0 - 191.255.255.255.
ⅲ The default subnet mask for Class B networks is 255.255.0.0, which can also be written as /16.
ⅳ The maximum number of hosts in a class B network is 256×256-2=65534.

c. Class C Address

ⅰ The first byte of the C class address (the highest bit is fixed at 110), the second byte, the third
byte, and the other 1 byte are the host address.
ⅱ Class C address range: 192.0.0.0 - 223.255.255.255.
ⅲ The default subnet mask of a Class C network is 255.255.255.0, which can also be written as
/24.
ⅳ The maximum number of hosts in a class C network is 256-2=254.
d. Class D Address

ⅰ Class D address is not divided into network address and host address. The highest bit of the first
byte is fixed at 1110.
ⅱ Class D address is used for multicast (also known as multicast) address without a subnet mask.
ⅲ Class D address range: 224.0.0.0 - 239.255.255.255.

e. Class E Address

ⅰ Class E address is also not divided into network address and host address. The highest bit of the
first byte is fixed at 11110.
ⅱ Class E address range: 240.0.0.0 - 255.255.255.255.
ⅲ Among them, 240.0.0.0-255.255.255.254 is the reserved address, mainly used for Internet
experiment and development. 255.255.255.255 is the broadcast address.

5. special IP address

The following special IP addresses cannot be assigned to hosts:

ⅰ The address whose host ID is all 0: refers to a certain network segment. For example:
192.168.10.0 255.255.255.0, refers to the 192.168.10.0 network segment.
ⅱ Addresses whose host ID are all 1: refer to all hosts in the network segment. For example:
192.168.10.255. If a computer sends data packets, using the IP address whose host ID is all 1, use
the broadcast address FF-FF-FF-FF-FF-FF for the data link layer address.
ⅲ 127.0.0.1 is the local loopback address, which refers to the local address and is generally used
for testing.
ⅳ 169.254.0.0-169.254.255.255 is actually an automatic private IP address.
ⅴ 0.0.0.0: If the computer's IP address conflicts with other computer address on the network, using
the ipconfig command will see 0.0.0.0. Besides, the subnet mask will also be 0.0.0.0.

Practice part
Part 1: IP Subnetting

1. Objectives
a. To study the characteristics of IP and Subnet.
b. To study the method of IP setting and subnet mask setting.
2. Equipment
a. Two 24-port Catalyst switch 2950
b. Four PCs
c. A router-PT

3. Description of laboratory experiment set-up

4. Procedure and questions

a. Verify the cable connections as shown in the experiment diagram.


b. Set two network segments(10.0.0.0&11.0.0.0). Router0 connects those different network
segments. Switch0 connects devices under 10.0.0.0, switch2 connects devices under 11.0.0.0.
How to set?

Result as follow:
c. Configure the IP network address and subnet mask on PC0, PC1, PC4 and PC5. Respectively,
as shown in the follow table. (Refer to Appendix C on how to configure a host).
PC0 PC1 PC4 PC5
IP Address 10.0.0.2 10.0.0.3 11.0.0.2 11.0.0.3
Subnet mask 255.0.0.0 255.0.0.0 255.0.0.0 255.0.0.0

How to configure?

Results as follows:
d. Verify to insure successful connects between the PCs by using the “ping” function from the
Command Prompt Window.

C:\>ping PC IP address

e. Ping from the PC0 to PC1.


Was ping successful?
Yes.
Why?
Because PC0 and PC1 are under the same subnet. So if the IP addresses are correct, ping will be
successful.

f. Ping from the PC0 to PC5.


Was ping successful?
No.
Why?
Because PC0 and PC1 are under different subnets. If we want to ping successful, we need to set
network connection of the Router0.
Part2 Switching

1 Switching:
1.1 Concept of switching:
In computer networks, switching means to connect one telephone line to another so
that they can transmit data to each other.
1.2 Types of communication
1.2.1 Circuit switching:
Circuit switching is a switching method for the purpose of circuit connection.
Before communication, a physical channel is established between the two
communication parties.
1.2.2 Packet (datagram) switching:
Packet switching is transmitted and switched in the unit of packets. It is a store-
forward switching mode. Packets that are about to arrive at the switch are first
sent to the memory for temporary storage and processing, and then sent out when
the corresponding output circuit is idle.
1.3 Circuit switching
Circuit switching has three stages: establishing a connection, communicating, and
releasing a connection.
The most classic circuit switching system is the telephone system:

Only one connection can be established at a time!

Based on the characteristics of exclusive channel of circuit connection, it has the


following advantages:
- Because the communication line is dedicated to both users and the data is direct,
the delay of data transmission is very small.
- Once the communication channel between the two parties is established, the two
parties can communicate at any time, with strong real-time performance.
- When the two parties communicate, the data is transmitted in the order of sending.
There is no out-of-order problem.
- Circuit switching is suitable for transmitting both analog and digital signals.
- The switching equipment and control of circuit switching are relatively simple.
At the same time, there are big disadvantages:
- The average circuit - switched connection establishment time is long for computer
communication.
- After a circuit switch connection is established, the physical path is exclusive to
both communication parties. Even if the communication line is idle, it cannot be
used by other users, so the channel utilization is low.
- Circuit switching, data direct, different types, different specifications, different
rates of terminals are difficult to communicate with each other, it is difficult to
carry out error control in the communication process.
1.4 Packet(datagram) switching
Packet switching, also known as packet switching, divides the user's communication
data into several smaller data segments of equal length. In front of each data segment,
the necessary control information is added as the header of the data segment, and each
data segment with the header constitutes a packet. The header indicates the address to
which the packet is sent. When the switch receives the packet, it forwards the packet to
the destination according to the address information in the header. This process is
packet switching. A communication network capable of packet switching is called a
packet switched network.
Packet-switched essence is to transmit data in a certain length into many groups, in
order to accurately transmitted to each other, each group identity, on a number of
different data group on physical line transmission, on the basis of dynamic sharing and
reuse in order to be able to make full use of resources, when the data packets to the
switch, and temporary storage of switches, Then according to the busy level of the
current line, the switch will dynamically allocate appropriate physical lines to continue
the transmission of data packets until they are transmitted to the destination. After
arriving at the destination, the data groups are recombined to form a complete data.

Packet switching has the following advantages and disadvantages.


- Packet switching does not require a dedicated communication line to be
established in advance, and there is no connection establishment delay. Users can
send packets at any time.
- Because the storage and forwarding mode is adopted and the switching nodes
have path selection, other transmission lines can be selected when one
transmission line fails, which improves the transmission reliability.
- Instead of occupying a communication line in a fixed way, they occupy the
physical path in different periods of time, thus greatly improving the utilization
rate of the communication line.
- Speed up the transmission of data in the network. Therefore, packets are
transmitted one by one, and the storage operation of the latter packet can be
parallel with the forwarding operation of the previous packet. This pipelined
transmission mode reduces the transmission time.
- The packet length is fixed, and the corresponding buffer size is also fixed, so the
management of memory in switching nodes is simplified.
- The packet is shorter, the error probability is reduced, and the amount of data
retransmitted each time is also reduced, which not only improves the reliability,
but also reduces the delay.

But packet switching also has some disadvantages:


- Since the data must undergo the process of storage and forwarding after entering
the switching node, the forwarding delay (including receiving packet, checking
correctness, queuing, sending time, etc.) will be caused. Moreover, the larger the
network communication volume, the greater the delay will be, and the real-time
performance is poor.
- Packet switching applies only to digital signals.
- Packet switching may be out of order, and packets may be lost or duplicated.
When packets arrive at the destination node, they need to be sorted by number,
which increases trouble.
1.5 To sum up, if the amount of data transmitted is large and the transmission time is much
longer than the call time, circuit switching is more suitable. Packet switching is more
suitable when the end - to - end pathway consists of many links. Packet switching is
superior to circuit switching in terms of improving the channel utilization of the whole
network.

2 Switch
To implement packet switching, switches appeared. A switch is a network device used to
forward electrical (optical) signals. It can provide exclusive electrical signal pathways for any
two network nodes of the access switch. The most common switch is an Ethernet switch.
Other common are telephone voice switch, Fiber Channel switch and so on.
2.1 Collision domain
A collision domain is a region to which data must be sent. HUB is a signal driver
without intelligence, and the whole network composed of hubs is a conflict domain. The
network under an interface of a switch is a conflict domain, so the switch can isolate the
conflict domain.
2.2 Broadcast domains
The area to which data can be sent when broadcast is a broadcast domain. Switches and
hubs are transparent to broadcast frames, so a network of switches and hubs is a
broadcast domain. A router's interface under the network is a broadcast domain. So, the
router can isolate the broadcast domain.
2.3 Working principle:
The switch can "learn" the MAC address and store it in an internal address table, making
the data frame go directly from the source address to the destination address by
establishing a temporary exchange path between the originator and the destination
receiver of the data frame.
2.4 Forwarding decision:
The switch's forwarding decision has three operations: drop, forward, and diffusion.
- Filter: If the port on which the switch receives the data frame is the same as the
port on which it forwards the data frame, the switch discards the data frame and
does not forward the data frame.
- Forwarding: Forwards the packets when a host on a port accesses a host on a
known port.
- Flooding: When a host connected to a port accesses a host connected to an
unknown port, the host needs to be diffused.
The MAC address of the sender is recorded for each operation, so that other hosts can
access it.

Part of Practice I
3 Implement the switch working principle
First, create the following topology on the packet tracer and configure the IP address and
mask of each PC.

Enter the simulation mode and view the MAC address table of the switch in the initial state.
Q1:If PC2 sends a message to PC1, how does the packet propagate?
A1:Because the MAC address table of the switch is empty, the switch floods the
packet after receiving it, that is, it forwards the packet to all other ports.

After PC0 pings PC2, check the process and record the MAC address table.

Then it sends signals to other PCs and checks the MAC address table.

Finally, clear the MAC address table to test the broadcast domain and let PC0 send broadcast
frames.
Q2:If PC2 sends a message to PC1 again, how does the packet propagate?
A2:In this case, the MAC address of PC1 already exists in the MAC address
table. Therefore, the switch directly forwards the packet to the port connected to
PC1.
4 VLAN (Virtual Local Area Network)
A virtual local area network (VLAN) is a communication technology that logically divides a
physical LAN into multiple broadcast domains. Each VLAN is a broadcast domain. Hosts in
a VLAN can directly communicate with each other, but VLANs cannot. In this way,
broadcast packets are restricted to a VLAN.
Early Ethernet is a data network communication technology based on CSMA/CD (Carrier
Sense Multiple Access/Collision Detection) sharing communication medium. When the
number of hosts is too large, there will be serious conflicts, broadcast flooding, performance
degradation and even network unavailability. Although LAN interconnection through Layer 2
devices can resolve serious conflicts, it still fails to isolate broadcast packets and improve
network quality. In this case, VLAN technology appears.
In this way, a LAN can be divided into multiple logical VLANs. Each VLAN is a broadcast
domain. Hosts in a VLAN can communicate with each other just as in a LAN.

Part of practice II
5 Implement a simple VLAN with two switches
Build the following topology diagram and configure the IP of each PC:

Q3:Can PC0 send a ping to PC2? Why?


A3:Yes, although they are connected to different switches, the switches belong
to the same broadcast domain and can communicate with each other as long as
they belong to the same network segment.
Configure each switch and add VLAN10 and VLAN20. Assign ports PC0 and PC2 to
VLAN10 and ports PC1 and PC3 to VLAN20, and set the ports connected to the two
switches to trunk mode:

Q4:Can PC0 send a ping to PC1 now? Why?


A4:No, although they are connected to the same switch, the broadcast domain is
divided by a VLAN. Currently, they are not in the same broadcast domain. If they
want to communicate, they need the help of a router or layer 3 switch.

The connectivity test shows that although PC0 and PC1 are in the same network segment,
they cannot communicate with each other because they are in different VLANs.
Part3 Routing
Routing
1. Objectives

a. To study the principle of routing.


b. Learn how to use routing to connect subnets.

2. Equipment

a. A router
b. Two switches
c. 4 PCs

3. Description of laboratory experiment set-up

We use one router, two switches and four hosts to connect the two subnets. Its topology is
shown below.

\
Figure 1

4. Procedure and Results

A. Connect the components based on the topology.

B. Assign IP addresses, masks, and gateways to PCS and switches on each subnet, as shown
in chart 1.

Component IP Address Gateway Subnet Mask


PC0 192.168.10.1 192.168.10.254 255.255.255.0
PC1 192.168.10.2 192.168.10.254 255.255.255.0
PC2 192.168.80.1 192.168.80.254 255.255.255.0
PC3 192.168.80.2 192.168.80.254 255.255.255.0
Chart 1

Q1. Why should the IP address of the computer be the same subnet as the IP address of
the gateway to access the Internet?

Ans:_______________________________________________________________________
___________________________________________________________________________

C. Create vlan1.

D. Switch to the interface mode and add the interface Fa0/2 , Fa0/3 and Fa0/4 to vlan1.

Q2:Why did we change f0/4 to a trunk interface here?


Ans:___________________________________________________________________
_______________________________________________________________________
_

E. Creating vlan2 and repeating the process, we end up with the result shown in Figure 2.
Figure 2

Q3. Can we now implement communication between PC0 and PC1? What about PC0 and
PC2?
Ans:_______________________________________________________________________
___________________________________________________________________________

F. Configuring the router.


The IP address and subnet mask of interface f0/0 are ______ and _______.
The IP address and subnet mask of interface f0/1 are ______ and _______.

Q4.Does the router's IP address have to be the same as the default gateway?
Ans:___________________________________________________________________________
_______________________________________________________________________

G. Activate two interfaces.

Q5:Must the gateway ip address and any interface ip address have the same subnet?
Ans:_______________________________________________________________________
___________________________________________________________________________

Ans1: The gateway is meant to generate a default route. Default routing means: Who should I send
a packet to when the object I want to communicate with is not in my subnet?
When you specify a gateway, the gateway must be on the same network segment as your
computer. Otherwise, the computer cannot figure out how to reach the gateway, that is, the
computer does not know the exit of the current subnet.

Ans2: The trunk function is used to cascade switches. By sacrificing the number of ports, the trunk
function provides bundled high bandwidth for data exchange between switches, improving
network speed, breaking through network bottlenecks, and greatly improving network
performance.

Ans3: PC0 and PC1 can communicate. Because they have the same subnet mask and gateway.
PC0 and PC2 cannot communicate because they have different gateways.

Ans4: The ip address of the router does not have to be the same as the default gateway. The
gateway is shared by all hosts in the LAN, that is, the router address.
The default gateway must be the ip address of the router, because the network egress of all hosts in
the LAN is the port of the route. The ip address of the router (the default gateway of the host) must
be on the same network segment as the ip addresses of all hosts, but cannot conflict.

Ans5: Yes. If your PC needs to access the Internet through a router or access a different network
segment, you must set the IP address of the PC and the IP address of the port connected to the
router to be on the same network segment. Otherwise, the PC cannot access the Internet or
communicate across network segments.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy