HCIA Review: OSI Model

1. Open system interconnection reference model

OSI: Open Systems Interconnection Reference Model

1. Application layer:

Encoding abstract language

2. Presentation layer:

Convert encoding to binary

3. Session layer:

Provides a reply address, suggesting an end-to-end reply to the application

The upper three layers are the stages of data processing by the application layer, collectively referred to as the application layer.

4. Transport layer:

Provide port number and segmentation TCP/UDP

4.1 Segmentation:

Oversized data packets cannot share the bandwidth with others in the network, and bandwidth preemption will occur, causing data packet damage and greatly increasing network delay; therefore, data packets must be segmented unexpectedly; the segmentation is limited by the MTU

MTU: maximum transmission unit, default is 1500;

4.2. Port number:

16 bits are composed of binary, the value range is 0--65535, of which 1-1023 is the specified port, 1024-65535 is the dynamic port, high port,

When the client accesses the server, the client randomly uses the high-end port number and source port number to laugh to mark the local process, and uses the indicated port number to correspond to the service;

例:http 80;https  443; dns  53;ftp21;ssh  22;telent 23......

4.3、UDP

User data message protocol connection unreliable transport protocol

Only the basics of transport are done - segmenting and providing port numbers

4.4、TCP

Transmission Control Protocol Reliable protocol for connection-oriented connections : In addition to completing the basic work of the transport layer, it also needs to ensure the reliability of the transmission

Face-to-face connection: Before transmitting data, an end-to-end virtual link needs to be established through a three-way handshake (request, response, confirmation)

Reliable transmission: 4 reliable transmission mechanisms are used in the transmission process (confirmation, sorting, flow control (sliding window), retransmission)

5. Network layer

Internet Protocol—IP Address

Function: logical addressing

6. Data link layer

Media Access Control: Control physical devices

The core function of the data link layer is to control the physical layer equipment. Because the physical layer equipment cannot work automatically and needs long-term control, most network environments use Ethernet technology in the physical layer, so the thinking of the data link layer is mostly based on Ethernet Layer 2 encapsulation

Ethernet layer 2 frame header

 Only Ethernet technology uses MAC addresses for physical addressing at Layer 2

7. Physical layer

2. Annotation of network terms

【1】TCP/IP protocol

The TCP/IP protocol stack is the predecessor of the OSI model and is also the current model that is actually running.

The difference between TCP/IP and OSI model:

1. Different levels

2. TCP/IP only supports IP protocol at layer three, while OSI supports all network protocols.

3. TCP/IP supports cross-layer encapsulation, that is, jump-layer encapsulation

    Its main function lies in inter-device protocols, reducing layers and speeding up calculations; the cross-layer encapsulation protocol used for indirect connections is ICMP.

    When a layer is crossed, the work of the crossed layer must be temporarily performed by other layers;

There is no transport layer when the network is disconnected: When the application layer data packet is directly connected across layers to the network layer, the IP header will be fragmented, and the data will be filled into the header to replace the fragmentation, and the protocol number will replace the port number.

When there is no transport layer and network layer, application layer packets directly cross layers to the data link layer.

If the second layer is Ethernet encapsulation, the second generation Ethernet header can no longer be used and the first generation header must be used.

The first generation Ethernet header is divided into two layers, LLC logical link control sublayer + MAC to access control sublayer

LLC is the 802.2 header and MAC is the 802.3 header

LLC is responsible for fragmentation and providing frame type numbers

MAC is responsible for the normal MAC address and preamble

【2】Encapsulation and decapsulation

Encapsulation: a process of processing by Xihu Bureau from the top to the bottom. During the process, the data packets continue to become larger.

Decapsulation: a process of reading data from the bottom to the top. During the process, the data packets continue to become smaller.

For normal communication, the two devices must have the same target IP address;

How to obtain an IP address:

1. Domain name 2. APP record 3. Directly provided by the administrator

PC: The accessed target IP address is in the same network segment as the local one (ARP obtains the peer MAC address, gives up communication if the acquisition fails, waits for timeout, and communicates normally after successful acquisition)

Switch: After receiving a piece of bit stream information, it first identifies the Layer 2 data frame, first checks the source MAC address in the data frame, maps the corresponding incoming interface and records it in the local MAC address table, and then pays attention to the MAC in the data frame. The address is queried based on the local MAC table. The records in the table will be unicast forwarded according to the records. If there is no record, the traffic will be flooded;

router

【3】APR:

After receiving a piece of bit stream information, first identify the layer 2 data frame, check the target address, then discard or decapsulate it, decapsulate it to layer 3 and then focus on the target IP address, query the local routing table, if there is a record in the table, it will be unconditionally followed The record is re-encapsulated on Layer 2 and then forwarded. If there is no record, the traffic will be discarded.

Address Resolution Protocol

Forward ARP: The target IP address of the same network is known, and the MAC address corresponding to the IP address is obtained through broadcast

Reverse ARP: Know the local MAC address and obtain the local IP address of the peer

Gratuitous ARP (free ARP): When the device uses a new IP address or obtains an IP address, it actively performs forward ARP. The requested IP address is the local IP address; once approved, it represents an IP address conflict. (for detection of IP address conflicts)

【4】PDU

Protocol data unit, different recording units for data recording at different levels

Upper three layers: data packets

Transport layer: data segment

Network layer: packets

Data link layer: data frame

Physical layer: bitstream

【5】DNS

Domain name resolution is used to record the relationship between domain names and IP addresses. When placing domain names, the DNS server needs to resolve the corresponding IP address, and then the client can access it.

【6】IPV4 address

IPv4 addresses are composed of 32-bit binary numbers and are identified by decimal numbers;

ABCDE classification, where ABC is a unicast address; D is a multicast address, and E is a reserved address.

ABC is a unicast address, but based on the default mask length in ABC

special IP address

1. The host bits are all 0: network number

2. The host bits are all 1: connect to the broadcast address

3. All 0: default route (all), invalid address (none)

4. Host bits are all 1-255.255.255.255 restricted broadcast

5. 127 127.0.0.1—loopback address

6. 169.254.0.0/16 Automatic private address, local link address. After the terminal fails to obtain an IP address through DHCP, the IP address is automatically configured. The network bit is fixed at 169.254 and the host bit is locally random.

Note: Only unicast addresses can be used as destination IP addresses or source IP addresses. Addresses in other areas can only be used as destination IP addresses. Therefore, as long as an IP address is configured for a device, a unicast address must be configured.

VLSM: Variable length subnet mask: subnet division, by extending the length of the subnet mask, borrowing the host bit to the network bit, logically dividing a network number into multiple effects

CIDP: Classless inter-domain routing: take the same number, remove the different bits, and combine multiple network numbers into one network segment

There are two types of subnet summary and supernet summary 

Subnet summary: After summary, the mask of the summary network segment is longer than or equal to the main class

Supernet summary: After summarization, the length of the summary network segment is shorter than the main class

【7】Static routing

Basic writing:

[r1]ip route-static 192.168.3.0 24 192.168.2.2—Next hop of the target network segment

Next hop address: The IP address of the next entry interface after traffic is sent from the local area.

[r1]ip route-static 192.168.3.0 24  GigabitEthernet 0/0/0 target network number, outgoing interface

Outgoing interface: When traffic is sent out from the local area, the local outgoing interface

Differences in writing:

It is recommended to use the next hop writing method in the MA network and the outbound interface writing method in the point-to-point network.

MA: There is no limit on the number of nodes in a network segment

Point-to-point: Only two nodes can exist in a network segment 

1. If the outbound interface is used in the MA network, in order to obtain the next MAC address, the device will automatically use proxy ARP and ICMP vertical direction to run, which will consume a lot of network resources and increase network delay, so it is recommended to directly Use the next writing method;

Proxy ARP: When the routing table of the router is written as an outbound interface, it will automatically make an ARP request to the target p address. The router is in network segment A, but receives an ARP request from network segment B. It will query the local routing table. If there is an ARP request in the table, For the route of network segment B, the proxy becomes the target IP address for ARP response
CMP vertical direction: the traffic enters from the A port of the router, and after querying the routing table, it is still transferred from A port. Then the router determines that the local path is not the best, and will jump up. The device responds to the best next hop address:

2. In a point-to-point network, if you use the next hop writing method:

Since the router's table lookup rules are longest match and recursive search, the next hop writing method will not be faster in the point-to-point network than the outbound interface table lookup method;

Extended configuration:

Load balancing: When a router needs to access a target with multiple paths with similar costs, it can allow the device to split the traffic and delay transmission on multiple paths at the same time;

1. Manual summary

When the router accesses multiple consecutive subnets (network segments that can be summarized and calculated) and passes the same path, these network segments can be summarized and calculated, and only the routing entries to the summarized network segment can be written; greatly reducing The number of routing entries written ultimately speeds up the efficiency of table lookup.

2. Routing black hole

If the summarized routing entries include network segments that do not actually exist in the network, misunderstandings will occur when accessing these network segments, resulting in a waste of computing resources on the device;

   Active blackhole: Address planning causes non-existent networks to be included in summary routes

   Passive black hole: A black hole appears when some of the detailed network segments that have been summarized are temporarily disconnected during the actual project.

3. Default route

A routing entry that does not limit the destination; the router will use the default route only after querying all local directly connected, static, and dynamic routers and still has no reachable path;

4. Empty interface

When the default route and the routing blackhole meet, a loop will inevitably occur. Configuring an empty interface route to the summary network segment on the blackhole router can be used to prevent the occurrence of loops: whether passive or active blackhole:

[r1]ip route-static 1.1.0.0 22 NULLO

5. Floating static routing

By modifying the default priority of static routing, the effect of path backup is achieved. The default priority of static routing is 60.

[R1]ip route-static 99.1.1.0 24 21.1.1.2 preference 61

Guess you like

Origin blog.csdn.net/2301_77475090/article/details/131812709