Network equipment and protocols - equipment

Network equipment and protocols - equipment

Preface

When answering questions about computer networks during interviews, it is very common for candidates to explain the TCP three-way handshake, four-way wave, or the details of the OSI seven-layer model.

When asked about how data packets are transmitted on the network, such as IP routing, ARP addressing, the difference between switches and routers, the conversion between private IP and global IP, etc., they can only remain silent.

This article will sort out the detailed process of sending data packets from one host to another in the network, including network devices such as modems, repeaters, network cards, switches, routers, and IP protocol-related technologies such as DNS, ARP, DHCP, NAT, ICMP, etc.

[[322930]]

equipment

Building a network environment involves a variety of cables and network equipment. Since we need to understand data transmission, we must first understand the media of data transmission.

As shown in the figure, host A sends data packets to host B, which need to pass through switches, routers and other devices. However, at the physical layer (Layer 1 of the OSI model), modems and repeaters are also required.

1. Modem

When setting up broadband in a modern home network, you can see the modem (English: Modem) connected to the router, which we generally affectionately call a "cat".

A modem is an electronic device that converts digital signals generated by a computer into analog signals for transmission, and demodulates received analog signals to obtain digital signals.

In the past, people used telephone modems to access the Internet via telephone lines. Now, we use fiber optic modems to access the Internet, which are used to convert digital signals into fiber optic signals.

2. Repeater

Like modems, repeaters also work at the physical layer. Their function is to adjust and amplify the waveform of the electrical or optical signal transmitted through the cable and then transmit it to another cable. In short, a repeater is a device that amplifies and sends weakened signals.

3. Network card

A network card is a must for a computer to access the Internet, and most computers now have built-in network cards.

A network card, also known as a network adapter or LAN card, is a piece of computer hardware designed to allow computers to communicate on a computer network. Because it has a MAC address, it belongs to Layer 2 (Data Link Layer) of the OSI model.

The MAC address of the computer or the host we are talking about is actually the MAC address of the network card.

As shown in the figure below, Mac computers can view the current computer's MAC address in "System Preferences - Network - Wi-Fi - Advanced - Hardware".

4. Switch

A switch is a network device that receives and forwards data to a target device through message exchange.

In short, a switch receives data packets, checks the destination address of the data packet to select a route, and forwards the data packet to the next-hop router.

It should be clear that the switch does not modify the data packet, it is only responsible for forwarding the data packet.

A switch is also called a bridge or a layer 2 switch. The so-called layer 2 means working at the data link layer. This means that when the switch forwards a data packet, it does not know or need to know the IP address of the source host and the destination host, but only needs to know their MAC address.

How a switch works:

The CPU inside the switch will form a MAC table by matching the MAC address and port when each port is successfully connected.

When a switch is installed and configured, its working process is as follows:

  • Switch port 1 receives a packet from a computer with MAC address X to a computer with MAC address Y, and the switch remembers that MAC address X is on port 1. (Learning)
  • If the destination MAC address Y cannot be found in the MAC table, the switch will forward the packet to all ports except port 1. (Flooding)
  • The computer with MAC address Y receives the data packet and sends a confirmation packet to MAC address X. After the switch receives the packet, it records the network segment where MAC address Y is located.
  • The switch forwards the confirmation packet to MAC address X. (Forward)
  • When a switch receives a data packet, it checks the table and finds that the source address and destination address of the data packet belong to the same port. The switch will not process the data packet. (Filtering)
  • Each record in the MAC address-port query table inside the switch uses a timestamp to record the time of the last access. Records older than a certain threshold (user-configurable) are cleared. (Aging)

5. Router

A router can connect different data links, such as connecting two Ethernet networks. Nowadays, the broadband routers that people use to connect to the Internet at home or in the office are also a type of router.

A router is a device that connects two networks and forwards packets at the third layer of the OSI model, the network layer.

The switch processes based on the physical address (MAC address) and refers to the MAC table, while the router processes based on the IP address and refers to a table called the routing control table.

Routing control table:

The address used when sending a data packet is the IP address of the network layer. However, the IP address alone is not enough to send the data packet to the destination address on the other end. In the process of data transmission, information such as "specifying the next router or host" is also required in order to actually send it to the destination address. The routing control table is where this information is stored.

Hosts and routers that implement IP communication must have such a table. It is based on this table that they can send data packets.

There are two ways to form the routing control table: one is manual setting by the administrator, and the other is automatic refresh when the router exchanges information with other routers. The former is also called static routing control, and the latter is called dynamic routing control.

In order for dynamic routing to refresh the routing table in a timely manner, routing protocols must be set up between interconnected routers on the network to ensure normal reading of routing control information.

The routing control table records the network address and the address of the router to which the packet should be sent next. When sending an IP packet, the destination address in the IP packet header must be determined first, and then the record with the same network address as the address is found in the routing control table. The IP packet is forwarded to the corresponding next router based on the record.

If there are multiple records of the same network address in the routing control table, the one that best matches is selected. The so-called best match means the one with the most identical digits.

For example, the network address 172.20.100.52 matches both 172.20/16 and 172.20.100/24. In this case, 172.20.100/24, which has the longest match, should be selected.

The default route is a record that any address in the routing table can match. The default route is usually marked as 0.0.0.0/0 or default. The 0.0.0.0/0 here does not mean that the IP address is 0.0.0.0. In order to avoid people mistakenly thinking that 0.0.0.0 is an IP address, the suffix is ​​/0.

<<:  Why is 5G considered the criterion for the Internet of Things era?

>>:  "New infrastructure" is a super hot spot, with direct investment exceeding 10 trillion yuan and driving investment exceeding 17 trillion yuan

Recommend

Top 5 WiFi Network Predictions for 2017

We have seen WiFi undergo rapid changes, and in 2...

Learn about routers, switches, and network hardware

Today we're taking a look at home network har...

GSA identifies 4G/5G private network deployments in 40 countries

London, UK, May 17, 2021 - The Global Mobile Supp...

Let’s talk about gRPC that you don’t know today

Hello everyone, I am Zhibeijun. It is the last da...

A brief discussion on operation and maintenance under SDN architecture

At present, the domestic network operation and ma...

Three steps to take before deploying SD-WAN

As enterprises develop their network strategies a...

Detailed explanation: How did China Mobile perform in 2020?

[[390976]] Compared with China Telecom and China ...

Singapore to shut down 3G and reallocate spectrum for 5G

Singapore will shut down its 3G network in July n...