There are different tables in it on switches and routers,
Layer 2 switches have
mac
table, arp
table, QoS
priority queue table, port status
state table
MAC
The table is the mapping relationship between the switch and the address port
of the end network card connected to the network cablepc
mac
Generally,
mac
table , and ports andmac
bindings are adopted. Other times, they are not recorded by default.
The arp
table of the switch is used to record the address table of different devices vlan
under the switch ip
and address table mac
of the devices ip
connectedmac
Among them
vlan2
, themac
address is the default address of the switch, and all switches use this address at thevlan
beginning
but can be changed
QoS
Quality of service priority table
The priority can be set MIME
, if not set, the default priority will be used
port status
The status table is the status of each port, not introduced
Note:
Each port
is essentially a network card
The switch is a layer 2 device, and port
each of must be connected to a device, and each port
is not configured ip
, only the physical connection of the device is recorded.mac
However, some current switches will have vlan
a configuration. vlan
( Virtual LAN ) is a virtual configuration that simulates
Layer 3. On the basis of Layer 2, multiple subnets are divided again, and each vlan
can be configured with IP
an address.
If ip
there is mac
, it can be used as a complete network device
All functions of the switch are for better realization of 收束
functions , and to mac
achieve mutual search through
This is why the main table of the switch is the
mac
table , and this is why the switch can be used without configuration (the default recordmac
address).
The additionalarp
table essentially just for conveniencevlan
.
arp
The table is the easiest way to quickly address in the same subnet, and it is also the most basic table for the conversion between Layer 2 and Layer 3.
Generally , the arp
tables of all hosts in a subnet are the same (in some cases, it is a security consideration)
In summary, it can be seen that mac
the most essential role is to lan
distinguish the internal equipment
The default gateway specifies:
A host can have multiple gateways. The default gateway means that if a host cannot find an available gateway, it will send the data packet to the default designated gateway, and this gateway will process the data packet.
The device that acts as a gateway must be a device that can implement the routing function (start the routing protocol).
Devices with routing capabilities include routers , servers with routing protocols enabled (essentially equivalent to a router), and proxy servers (also equivalent to a router).
The address of the gateway is the IP
address of the device with routing function IP
, but the last digit is not necessarily of xxx.xxx.xxx.1
this type. It can be specified at will, but you are just used to this type.
equipment designation
- In the switch, the default gateway will be set
vlan
under , and the default gateway will be set for allvlan
under thepc
- Of course, one of the Layer 3 routers can also be used
port
as the gateway of the access subnet (vlan
similar to , but this is professional and more powerful) - Or do not configure at all, select a server (host) in the domain and configure it as a device with a routing protocol, set it as the default gateway, and the device will perform routing and forwarding (eg: topology of one-arm routing)
A router is a layer 3 device, it does not need as many interfaces as a switch, it is essentially just addressing as fast as possible, so the main table isrouting table
And each layer 3 port
router can be regarded as a lan
(local area network) in essence, because port
each has mac
and ip
address,
To sum up, it can be seen that ip
the most essential role is to make wan
or distinguish equipment in a larger area
Layer 3 routers have
Routing
routing table, arp
table, NAT
table, QoS
table, port
table
Routing table
or routing information base
( RIB
)
- in the routing table
-
Lists routes to a specific network destination (essentially information about the network topology around it)
and in some cases also includes metrics (distance or weight) associated with those routes
The construction of routing tables is the main goal of routing protocols .
A static route is an entry created in the routing table by non-automatic means and is fixed rather than the result of some network topology "discovery" process (dynamic routing).
Onlyrouting table
the static route ( type:C
) is added here, and it can be known that the subnet segment ( the network part derived from the subnet mask and port configuration ) connected under the
corresponding port
port (usually the default gateway will be setip
under this port) is not specified . , indicating that after manual configuration, there is still no connection (not found)ip
port
IP
next hop
ip