Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Network system composition, OSI model, TCP/IP protocol suite

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Basic knowledge of Network and its basic Architecture Operation

The network connects the equipment and the terminal to realize the basic functions of data communication and resource sharing, which is composed of hardware and software. Network resource sharing is the sharing of data and applications, resources, network storage devices and backup devices.

The hardware of the network is composed of computers, various network communication devices and interactive devices, of which the computer is the most important part. The computer consists of five parts, namely, input device, output device, controller, memory and arithmetic unit, in which the calculator, also known as CPU,CPU, is the core of the computer, which determines the performance of the computer. There are many network communication devices, which are divided into wired and wireless types. Wired equipment has open wire, symmetrical cable, coaxial cable, optical fiber, etc.; wireless equipment has electromagnetic wave, infrared, ultraviolet and so on. Interactive devices include connectors, network interface cards, various media, and so on.

Common network communication devices and interactive connection devices are as follows:

(1) Network adapter: also known as network interface card (network card), it is plugged into the bus of the computer to connect the computer to other network devices. Generally, the network adapter only implements the functions of the network physical layer and the data connection layer.

(2) Network transceiver: it is the interface device of network adapter and transmission media. It provides signal level conversion and signal isolation.

(3) Network media conversion equipment: it is the conversion equipment between different transmission media in the network. Such as twisted pair and optical fiber.

(4) Multiplexer: a kind of terminal controller. It is used to improve the utilization rate of communication channel.

(5) interrupters: also known as transponders, extend the distance of transmission media, such as Ethernet interrupters can be used to connect different Ethernet network segments to form an Ethernet. 、

(6) Hub: for short, hub, which can be regarded as a multi-port interrupter (one interrupter is dual-port), are all network devices working in the physical layer.

(7) Bridge: two Lans can be connected into a logical LAN. A network connection device that operates at the physical layer and the data connection layer.

(8) switches: early switches were equivalent to multi-port bridges.

(9) Router: an interconnecting device between multiple networks working at the network layer. It can provide the function of path selection between networks.

(10) Gateway: it can be regarded as a general term for interconnecting devices between multiple networks, but generally refers to devices that interconnect multiple networks above the transport layer, also known as application layer gateways.

The software part of the network includes system software and application software. System software is used to connect and adjust the relationship between programs and hardware, to control and coordinate computers and external devices, and to support the development and application of software. System software enables users to interact with the computer without knowing how the underlying hardware operates. Application software is an application program written by users according to their specific needs and choosing the appropriate language and algorithm to solve a specific problem.

The network has seven characteristics: speed, cost, security, availability, scalability, reliability and topology. Speed 3 is called data rate, and the unit is commonly used in Mbps and Gbps. Cost is divided into tangible cost and intangible cost. The important thing is the topology structure of the network, which is divided into physical topology and logical topology. Physical topology includes star topology, bus topology and ring topology. For physical topology, star topology is the most ideal. For logical topology, bus topology is the best, because logical topology should try to avoid the generation of loops.

Two network layering models are generally accepted, namely, the OSI model and the TCP/IP protocol suite.

OSI model can be divided into seven layers, which are application layer, presentation layer, session layer, transport layer, network layer, data link layer and physical layer from top to bottom.

The network layer carries on the binary transmission and transmits the bit stream, which has four characteristics, namely, electrical characteristics, functional characteristics, process characteristics and mechanical characteristics. The data link layer establishes logical links and transmits data frames, which has three characteristics, namely, defining physical addresses, establishing logical connections and verifying frame data. The network layer transmits data packets with four functional characteristics, namely, interconnection of heterogeneous networks, determination of routes, definition of logical addresses, fragmentation and reorganization of data packets. The transport layer acts as a connecting link between the preceding and the following for the purpose of shielding the upper three layers to the lower three layers and shielding the specific details of the upper three layers to the upper three layers. The session layer carries on the communication between hosts, that is, this layer is the communication between processes, which is mainly divided into two forms, namely end-to-end communication and point-to-point communication. The presentation layer represents the data, so that the receiver can accept the data normally, process the data, and provide services to the upper application layer. The application layer provides user services and user authentication for various applications.

The TCP/IP protocol suite is divided into four layers: network access layer, Internet layer, transport layer and application layer. For the TCP/IP stack, the protocol is horizontal and the service is vertical. Among them, the application layer and transport layer are connected by protocol port, the transport layer and Internet layer are connected by protocol number, and the Internet layer and network access layer are connected by protocol type.

The Internet layer includes five protocols, namely, IP, ICMP, IGMP, ARP and RARP. The Internet layer has six protocol characteristics, which are running on the network layer, facing connectionless protocols, processing data packets independently, hierarchical addressing, best effort transmission, and no data recovery function. Connectionless means that there is no need to establish a communication connection before communication, there is no need to maintain the stability of the connection, and there is no need to dismantle the connection at the end of the communication. it carries out disordered transmission, and there is no data recovery mechanism and no data reliability guarantee mechanism. Addressing can be divided into two types: plane addressing and hierarchical addressing. Plane addressing is to divide the resources to be managed into several blocks according to a fixed size, and then address each small block independently, which is characterized by simple addressing and complex addressing, so the efficiency is extremely low. Memory is plane addressing, the speed of complete memory addressing is fast, and there is a comparison table in memory, so it is relatively easy to find, so plane addressing is adopted. Hierarchical addressing is to divide the managed resources according to certain rules and address them according to the corresponding categories, which is characterized by complex addressing and simple addressing.

For network transmission, IP address is the core of data transmission and addressing. IP address has three characteristics: first, the IP address can uniquely identify each device in the IP network; second, each host (computer, network equipment, peripheral equipment) must have a unique address; thirdly, the ID of the host is determined. Generally speaking, the IP address can be expressed as: IP address =. The network number is used to describe the network range in which the specified host is located, and the host number is used to describe the specific address in the specific network range of the specified host. Commonly known as the IP address is the IPv4 address, using 32-bit address structure, IP address identification can be from all zero to all one.

IP addresses are divided into 5 categories using dotted decimal method. The commonly used categories are A, B and C, which are classified as follows:

(1), class A: the first bit is 0, the network number is 8 digits, 0.0.0.01127.255.255.255, the first address 0 and 127 are not used. Where all 0 means invalid IP, which means the entire IP address stack is not used, and all 1 (127) except the first bit in the first 8-bit group is called loopback address and is not used.

(2), class B: the first place is 10, and the network number is 16 digits.

(3) Class C: the first place is 110 and the network number is 24 digits.

(4) Class D: the first bit is 1110 and the network number is 32 bits, which is usually used for multicast communication. Multicast communication can only be used as the destination address, not as the source.

(5) Class E: the first place is 1111, and the network number is reserved for scientific research.

For example, in class An addresses, all-zero and all-one are not used, and such addresses are called reserved addresses. Reserved addresses are reserved for the use of the network itself, and you cannot choose IP addresses that are configured for other hosts. There are six main types, as follows:

(1), 0.0.0.010.255.255.255

(2), 127.0.0.05127.255.255.255

(3), 169.254.0.05169.254.255.255 (automatically assigned address field) can not be used for routing, but can be used in part of the local area network.

(4) Network address: [host bit] an address with all zeros, indicating an address range name. For example: 1.0.0.0

(5) broadcast address: [host bit] all 1 address, as the destination address as all IP addresses in the entire network segment, for example: 1.255.255.255

(6) directed broadcast address: represents all IP addresses in the entire IP address stack as the destination address, for example: 255.255.255.255

The IP header format consists of 11 parts, as follows:

(1), Version: accounts for 4bits, protocol version information, IPv4 is 0100, and Version is 0110.

(2), IHL: account for 4 bits of the header length of the IP, with 15 lines in public. The default is 20 bytes. The length is between 20Byte~60Byte, but must be an integral multiple of 4.

(3) Service type: account for 8bits, divided into three parts. 4bits represents the type of service, which represents maximum bandwidth (0000, general service), minimum delay (0001), maximum throughput (0010), maximum reliability (0100), and minimum cost (1000). 1bit stands for reserved bit. 3bits indicates priority, and priority 000,000,111 increases in turn. Priority 000is the default value, and 111is network control.

(4) packet length: accounts for 16bits, packet length includes the first 20 bytes.

(5) Mark: occupies the 3bits, the first bit indicates the reserved bit; the second bit indicates whether the slice is sliced, if the slice is 1; the third bit indicates whether there are multiple slices, and the third bit is 1 after the slicing.

(6). Slice offset: accounts for 13bits, and slice offset represents the sequence number of IP protocol packet after slicing, that is, relative offset.

(7) Survival time: accounts for 8bits, which is equivalent to a counter to prevent the infinite circulation of data. Each packet gets an initial time-bound TTL value before transmission, and the TTL value is minus 1 for each route, and this data is no longer transmitted when the TTL value decreases to 0. The common initial values of TTL are 255,128,64.

(8) the protocol number: occupies 8bits, and the protocol number is the communication interface between the Internet layer and the transport layer. According to the different contents displayed by the protocol number, the received data is sent to different protocols of the transport layer for encapsulation. The TCP protocol number is 6, the UCP protocol number is 17, the OSPF protocol number is 89, and the EIGRP protocol number is 88.

(9), the first checksum: accounts for 16bits, carries on the reliability check of the first part.

(10) Source address: occupies 32bits, indicating the address of the sender

Destination: occupies 32bits, indicating the address of the receiver

The source IPv4 address is the IP address configured by the sending host, which can be configured manually or automatically. Manual configuration, that is, directly specify the IPv4 address of the host in the configuration file, manual configuration address configuration is accurate, but the repeated workload is large, easy to manual misconfiguration, not easy to check. Automatic configuration is to configure the host with IPv4 addresses using specific protocols, mainly using BOOTP and DHCP protocols. BOOTP startup protocol, broadcast addressing using RARP protocol to obtain IPv4 address from the address pool; DHCP dynamic host configuration protocol, with lease rules and lease term.

DHCP uses four-wire session protocol. First, the client broadcasts and sends the message, the server receives the message, checks whether its address pool has an available IP address, and returns to the client. After receiving the message, the client determines the IP address as the IP address of this communication, sends a client request to the server, and the server confirms the message and timing the lease.

There are two kinds of destination IP addresses: manual specification and automatic resolution. Automatic resolution is based on DNS protocol. There is a mapping relationship between domain name and IP address in DNS protocol, which can be used for forward resolution from domain name to IP address or reverse resolution from IP address to domain name.

The protocols used in each layer are different, the network access layer uses the Ethernet protocol, the network layer uses the IP protocol, and the transport layer uses the TCP/IP protocol. Port, also known as logical port or protocol port, is identified by 16bites binary system and is the operation interface between application layer and transport layer. Common protocol ports are: ssh:TCP/22; ftp (spanning Tree): TCP/21; http:TCP/80; https:TCP/443; SMTP:TCP/25; POP3:TCP/110; IMAP:TCP/143; DHCP:UDP/67 or UDP/68; DNS:TCP/53 or UDP/53

UDP protocol: oriented to connectionless protocol, no extra overhead for reliability mechanism, effective error checking, best-effort transmission, no data recovery function. But UDP is a high-speed, high-efficiency transmission, the most important thing is to transmit voice and video streams.

UDP header format: source port (16bits), destination port (16bits)

UDP data length (16bits), UDP data checksum (16bits)

Note: the source port generally chooses any idle port, and the destination port is fixed; in the process of round-trip communication, the ports of the two groups of data will be exchanged; the data length part includes the data part and the header, that is, including the header; the data checksum is a checksum at the time of sending and receiving, and the data is not lost if there is no change.

TCP protocol: located in the transport layer of the TCP/IP protocol stack, the network layer accessed by the application; running in full-duplex mode; connection-oriented protocol; packet serialization; error detection; receiving confirmation; with data recovery function.

The first part of TCP protocol is as follows:

Source port number (16bits) destination port number (16bits)

Serial number (32bits)

Confirmation number (32bits)

Header length (4bits) reserved bit (3bits) authentication encryption bit (3bits) URG ACK PSH RST SYN FIN window size (16bits)

Data checksum (16bits) emergency pointer (16bits)

Option (32bits)

The three-way handshake to establish the connection and the four-way handshake to remove the connection for TCP protocol connections are as follows

Three-way handshake to establish a connection:

1), SYN=1,seq=x,ack=0 sender generates and sends the first TCP header data

2), the SYN=1,ACK=1,seq=y,ack=x+1 receiver sends a TCP header data

3), the ACK=1,SYN=1,seq=x+1,ack=y+1 sender generates and sends the second TCP header data

Four-way handshake to remove the connection:

1), FIN=1,seq=u ack=0 sends the TCP header data of a FIN=1 to the other party

2) the ACK=1,seq=v,ack=u+1 recipient will reply the confirmation data after receiving it.

3) the other party of the FIN=1,seq=w,ack=u+1 sends the TCP header data of a FIN=1, requesting to dismantle the connection

4), ACK=1,seq=u+1,ack=w+1 sends confirmation and sends a TCP header data.

Confirmation features of the TCP protocol:

When the sender does not receive the confirmation data, it will not continue to send the next data; when the sender has not received the confirmation data after a specified period of time, the sender will resend the data to ensure the accuracy of data transmission.

The lower three layers of data transmission:

The first layer device, the physical layer, provides the physical medium and its coding, such as the physical interface of the hub, Ethernet, serial bus, repeater, and network card; the second layer device, the data link layer, provides the interface for the physical address, for example: the network card, the bridge, the switch; the third layer device, the network layer, provides the connection and path choice between the two hosts.

The process of dual-computer interconnection:

1) confirm the IP address of the target host, which can be obtained manually or by DNS parsing

2) choose the protocol used in the transport layer, and the TCP protocol is used for the interconnection of the two computers.

3) encapsulate the data with the header at the transport layer, establish a communication connection through a three-way handshake, and then send the data

4) use IP protocol to encapsulate the data and look up the ARP cache table to see if there is a MAC address of the target host

5) if the MAC address of the target host does not exist, the three-way handshake connection is temporarily stored in memory, and the ARP protocol request packet is generated using the ARP protocol, and then sent through the broadcast. When the destination host receives the ARP request packet, the destination host caches the MAC address of the source host, and then returns its IP address and MAC address to the source host in a unicast manner. After the source host receives the MAC address of the destination host, Cache to the source host and release the link established by the three-way handshake to proceed to the next step

If the MAC address of the destination host already exists, proceed directly to the next step

6) send data after confirming that the TCP link is correctly linked

7) when the destination host receives the data, each batch of data packets must be confirmed by the target host

8) after sending the data, disconnect the TCP data connection by waving your hand four times.

Network classification:

According to the geographical location, the network can be divided into local area network (LAN), metropolitan area network (MAN) and wide area network (WAN). For LAN, its components are mainly computers, interconnected devices, network devices and protocols; its main functions are data communication, resource sharing, and providing communication paths to other networks. At the same time, there are three communication modes in LAN: unicast, multicast and broadcast.

Advantages of Ethernet:

1) the competitive transmission mechanism is used, that is, for limited network resources, it has a first-come-first-come order.

2) the fair transmission mechanism is used, that is, for each device, it has the same opportunity to use network resources.

3) the CSMA/CD algorithm is used, that is, carrier monitoring, multi-access, collision and collision detection.

Ethernet frame structure (IEEE standard):

Preamble (7bytes), SOF frame delimiter (1bytes), destination address (6bytes), source address (6bytes), protocol type (2bytes), data part (46-1500bytes), FCS data parity bit (4bytes)

MAC address format:

The MAC address is 48 bits and consists of hexadecimal bits. Broadcast: 1bytes; Local: 1bytes; OUI:22bytes, organizational allocation; Vendor Distribution: 24bytes.

Communication media description format:

Format: n-signal type-media type.

In the format, n represents the maximum bandwidth of the media in Mbps. In the signal type, the baseband signal (digital signal) is BASE, and the broadband signal (frequency band signal) is PROAD. Among the media types, 5 represents thick coaxial cable, 2 represents thin coaxial cable, T represents unshielded twisted pair, F represents optical fiber, C represents cable, and X indicates that the media is full-duplex.

For unshielded twisted pair, the speed and throughput are 10-100Mbps, the price per node is the cheapest, the media and connection size are small, and the cable length of each segment can reach 100m. The classic connector for unshielded twisted pair is RG-45.

RG-45 has eight wires, four wires are used, the unused wires are used to shield the external interference, and the four pins used have two rules of use; rule one: 1Muk-transmit positive signal TX+, 2Mel-outward transmit negative signal TX-, 3-inward receive positive signal RX+, 6Mel-inward receive negative signal RX-. Rule 2: 1Mui-inward receives positive signal, RX+, 2mure-receives negative signal inward, RX-, 3mure-transmits positive signal outward, TX+, 6mure-transmits negative signal outward, TX-.

Unshielded twisted pair of 4 pairs of 8 wires, according to the color order is: T568A: White green, green, white orange, blue, white blue, orange, white rice dumplings, brown. T568B: White orange, orange, white green, blue, white blue, green, white rice dumplings, brown. Cross lines are used for the same type of interfaces, straight lines are used for different types of interfaces, and switch and hub interfaces are marked with x marks, such as 1x and 2x, so hubs and switches belong to the same type of interface; computer and router interfaces do not have x identification, so routers and computers belong to the same type of interface.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report