Super detailed summary of computer network experiment review

Computer Network Experiment Review

Click to download summary PDF

1. Transmission medium

EIA568A and 568B line sequence

568A: White-green/green/white-orange/blue/white-blue/orange/white-brown/brown

568B: white orange/orange/white green/blue/white blue/green/white brown/brown

1, 3 and 2, 6 exchange

How to distinguish between a straight cable and a cross cable, and what network environment are they applicable to?

When both ends of the twisted pair adopt the same standard connection method => straight cable => generally used to connect different devices (PC and switch, switch and router)

When the two ends of the twisted pair use different standards => crossover cable => generally used for the same device connection (PC and PC, PC and router)

Wiremap pair number actually used for communication

1, 2 are used for sending, 3, 6 are used for receiving => two orange, white and orange are used for sending; two green, white and green are used for receiving

4, 5, 7, 8 are bidirectional lines

Lighting sequence during straight-line and cross-line tests

Lighting together with the same color => the order is 12345678

2.DHCP

principle

① Send DHCP search packets to port 67 of all DHCP servers by means of UDP protocol and broadcast mode. (DHCPDISCOVER)

② After each DHCP server receives the broadcast request, it uses the UDP protocol to use port 68 to respond to a valid IP address to the client, and lock the IP address. (DHCPOFFER)

③ The client accepts the IP address of the first response, and broadcasts to notify all DHCP servers to confirm the acceptance. Except for the server that assigns the IP address, other servers unlock the IP address to be assigned and put it back into the address pool. (DHCPREQUEST)

④ After the selected DHCP server receives the confirmation information, it will reply to the confirmation information by broadcasting. (DHCPACK)

Network topology

insert image description here

insert image description here
ipconfig /all

insert image description here

3. DNS domain name resolution

principle

Query method: recursive query + iterative query

insert image description here

The process of the PC querying the preferred DNS server is called a recursive query, and the returned result is only the IP address or an error.

If the preferred DNS server does not know, the process of gradually asking other DNS servers (first ask .com, then ask baidu.com and then ask www.baidu.com) is called iterative query.

From the content of the query: the forward query uses the domain name to query the IP address, and the reverse query uses the IP address to query the domain name.

Network topology

insert image description here

4.HTTP

working principle

Client browser parses URL => client browser produces HTTP request information => server sends response HTTP page

At present, the three most mainstream Web servers are Apache, Nginx, and IIS.

IIS Internet Services Manager

Can provide services of www (port 80)/ftp (port 21)

5. Basic configuration of the switch

Basic Information

The Ethernet works at the data link layer

Priority: static over dynamic

Common commands

insert image description here
insert image description here

MAC (physical address)

insert image description here

MAC address table

A database in the switch for storing the mapping relationship between physical addresses and switch ports .

The switch forwards data according to the MAC address table.

insert image description here

Relevant knowledge points (just understand)

1. The principle of automatic learning: Assuming that PC1 sends a message to PC2, the data packet contains the MAC of PC1 and the IP of PC2. Since the switch does not know the MAC address of PC2, it sends a request ( flooding ) to all PCs. After PC2 receives the request, it replies to PC1. The data packet at this time contains the MAC address of PC2. When it passes through the switch, it learns MAC address of PC2.

2. The principle of automatic aging: delete a MAC address if it has not received a request for a long time, and re-request when it is received again.

3. Forward filtering.

MAC address related commands

Add one: (config) mac-address-table static MAC address vlan VLANID interface port

Delete one: (config) no mac-address-table static MAC address vlan VLANID interface port

View the table: show mac-address-table

Experimental content
insert image description here

​ 1. Configure the static mac addresses of the three PCs and delete the address of PC3

insert image description here
insert image description here

2. MAC address table after connectivity test

insert image description here

6. Switch VLAN configuration

VLAN (Virtual Local Area Network)

Features (do understand): 1. Grouping based on logic, not limited by physical location.

2. In the same VLAN and the same as the real LAN.

​ 3. Users in different VLANs need to use Layer 3 devices to communicate.

​ 4. VLAN standard - IEEE 802.1Q

Port division

ACCESS port: a port generally used to connect a computer ; an access port can only belong to one VLAN

TRUNK port: a port generally used for connection between switches ; can allow multiple VLANs to pass through

The trunk port has an ID value of the default VLAN (VLAN1), and the default VLANs of the trunk interfaces on both ends of the trunk link must be the same

Related commands

insert image description here
insert image description here
insert image description here

General steps

Divide VLAN => enter port => switch mode (switchport mode access) => set VLAN (switchport access vlan ID)

vlan id => interface id => switchport mode access => switchport access vlan id

main road steps

Enter port => switchport mode trunk => specify default VLAN (switchport trunk native vlan ID)

vlan id => switchport mode trunk => swicthport trunk native vlan id

Experimental content

insert image description here

Switch VLAN Configuration

insert image description here

Display VLAN information
insert image description here

Connectivity:

​ PC1 and PC3 can communicate, PC2 and PC4 can communicate

7. Static routing

direct network

A network directly connected to a router (ignoring the switch)

The IP of each router interface serves as the gateway (the village entrance) of the directly connected network .

Network segment calculation method:

insert image description here

Related commands

insert image description here

​ Set up static routes: ip route target network segment subnet mask (outside) port of the nearest router

insert image description here

Experimental content

insert image description here

Configure the router's two-port ip address** (remember to enable!!! no shutdown!!!)**

insert image description here

Configure the jump of the router (ie: when you want to query 192.168.3.0, you need to jump to the nearest 192.168.2.2)

insert image description here

show routing table
insert image description here

Experimental results:

​ Three PCs can ping each other

8. Communication between VLANs (required)

implementation plan

1. Router multi-port mode (generally, medium and large-scale LANs can have a large number of VLANs, while the number of router ports is small, and the router will become the bottleneck of LAN performance)

2. One-arm routing method (the router forwarding speed is limited, which cannot meet the demand of large amount of communication data between VLANs, and it is easy to cause a single point of failure)

3. Layer 3 switch mode

one-arm routing

insert image description here
insert image description here

Layer 2 switch (one-arm routing)
insert image description here

Configure the switch
insert image description here

Configure the router

insert image description here

show routing table

insert image description here

Experimental results

​ PC1 pings PC2

Layer 3 Switches (Key Points)

​Related configuration
insert image description here

​Experiment content

insert image description here

​ Configure a Layer 2 switch
insert image description here

Configure Layer 3 switches ( the last ip routing is indispensable!!! )
insert image description here

View routing table

insert image description here

test connectivity

​ Four PCs can be pinged

9. Dynamic Routing RIP

Type (do know)

RIPV1: use broadcast to send routing update, routing update information does not carry subnet mask , it is a classful routing protocol , does not support authentication

RIPV2: The method of sending update packets is multicast , and the subnet mask is carried in the routing update information. It is a classless routing protocol and supports authentication

Related configuration commands
insert image description here

RIPV1 experiment content
insert image description here

Configure the router

insert image description here

show routing table

insert image description here

RIPV2 experiment content

Configure the router

insert image description here

View routing table

insert image description here

10. NAT (Network Address Translation)

type

1. Static NAT: Convert each internal IP address to an external IP address in a one -to-one correspondence

2. Dynamic NAT: Dynamically translate an internal IP address to one IP address in a set of external IP addresses (address pool)

3. Overload NAT: A form of dynamic NAT that uses different port numbers to convert multiple internal IP addresses into one external IP address, also known as PAT, NAPT or port multiplexing NAT

Static NAT

insert image description here

Dynamic NAT
insert image description here

NAPT

insert image description here

Experimental content

insert image description here

Set up static NAT to achieve access:

Pay attention to ip route!!!

insert image description here

View routing table
insert image description here

Set static NAT so that the external network PC can access the web service of the internal network server through 2.2.2.10

insert image description here

Set up dynamic NAT and achieve access
insert image description here

NAPT

​ slightly

11. ARP (Address Resolution Protocol)

Basic knowledge (understand)

Works at the data link layer and converts IP addresses into physical addresses

The MAC address corresponding to the IP address of the destination host is forwarded directly.

If there is no MAC address corresponding to the IP address of the destination host, initiate an ARP request broadcast packet on this network segment for query.

Update the ARP list based on the MAC address information of the source host.

experiment procedure

1. View and delete the ARP cache (arp-a view arp-d delete)
insert image description here

2. Use Wireshark to capture ARP request response data packets

insert image description here
insert image description here

insert image description here
insert image description here
insert image description here

12. TCP (protocol analysis) may be able to capture packets

Basic knowledge (understand)

Host A sends a SYN segment indicating the port of host B that host A intends to connect to, and the initial sequence number seq, without the ACK flag. Host B responds by sending back a SYN segment containing the initial sequence number of host B. At the same time, the confirmation sequence number is set to the seq of host A plus 1 to confirm the SYN segment of host A.

Host A must set the confirmation sequence number to the seq of host B plus 1 to confirm the SYN segment of host B
insert image description here

experiment procedure

1. Open Wireshark and set the filter to "host 10.21.30.222" in the capture options. and start scraping data.

insert image description here

Open CMD, use the ftp command to access the ftp server, and finally exit.

insert image description here

2. Obtain packet capture data

(1) Third handshake
insert image description here

(2) Waving four times

insert image description here

13.HTTP

​ slightly

(Refuse to prostitute, start with me!!!)

Guess you like

Origin blog.csdn.net/ws15168689087/article/details/122137083