Basics of Data Communication for Network Security Introduction

1. OSI reference model

1. Broadcast domain and conflict domain
(1) Broadcast domain
Broadcast domain refers to the smallest scope of broadcasting
(2) Conflict domain
refers to the smallest scope of conflict
(3) Equipment characteristics
Hub and repeater: all ports belong to the same Conflict domain and the same broadcast domain;
switches, bridges: each port belongs to a different conflict domain, but all ports belong to the same broadcast domain;
router: each port belongs to a different conflict domain and a different broadcast domain.

2. OSI layered model

Application layer Provide access ports for users or software to use network services
Presentation layer Encoding, decoding, encryption, and decryption of data
Session layer Responsible for session management, that is, session establishment, maintenance and termination
Transport layer Establish end-to-end connection from the host to distinguish different upper-layer applications
Network layer Addressing and routing, that is, deciding how to route data from the sender to the receiver
data link layer Use MAC address to access the medium, error checking and combination of bit streams into frames
Physical layer Send and receive bit streams, specify wire-speed cables, etc.

3. Data encapsulation process
Insert picture description here
4. Corresponding protocol

(1) Physical layer
Equipment: hub, repeater
Protocol involved: none

(2) Data link layer (OSI-RM layer 2)
equipment: Layer 2 switches, bridges
Involved protocols: PPP (including PPPoE, PPPoA), HDLC, Frame-Relay
data unit : Frame, or data frame.

(3) Network layer (OSI-RM layer 3)
equipment: routers, layer 3 switches, gateway servers
, protocols involved: IP, IPX, ICMP (internet control message protocol), ARP (address resolution protocol), RARP (Reverse address resolution protocol)
Data unit: packet, or data packet.

(4) Transport layer (OSI-RM layer 4)
equipment: Layer 4 switches
Involved protocols: TCP, UDP
(TCP is a reliable connection-oriented protocol and a heavyweight protocol. The header length occupies at least 20 bytes.
UDP is a connectionless, unreliable protocol and a lightweight protocol with a header length of 8 bytes.
Among them, ftp, http, https, smtp , Telnet, DNS (server side) and other protocols are all based on TCP protocol communication; while tftp, OICQ, DNS (client), etc. are all based on UDP protocol communication.)

(5) Session layer
Protocol involved: none

(6) Presentation layer
Example: ASCII("A")=65
Protocol involved: None

(7) Application layer
Device: Layer 7 switch
Protocol involved: ftp, tftp, http, smtp, telnet, DNS

Supplement:
Router: forwarding data, used to connect to the wide area network, as the exit of the local area network, each interface divides the broadcast domain;
switch: builds the local area network, each interface divides the conflict domain;
LAN: a company, school, hospital, etc. internal network is called Local
area network ; WAN: The network connecting different local area networks is called WAN;

2. IP address

1. Definition

(1) The IP address is used to indicate the location of a certain device or a user on the network
(2) The IP address is divided into a network part and a host part;
(3) The IP address is composed of 32 binary, usually expressed in dotted decimal notation

2. Classification
Insert picture description here
3. Calculation

(1) Network address Network address: indicates an address whose host bits are all 0;
for example: the
existing IP address is 172.16.40.100/19, please calculate the network address of this IP address?
Solution: It can be seen from /19 that the network bit of the IP address occupies the first 19 bits of the IP address, then the host bit occupies 13 bits and because the host bit all 0 is the network address,
the network address of the IP address is 172.16.001 00000.0/19, which is 172.16.32.0/19.

(2) Broadcast address
Broadcast address: divided into limited broadcast address and global broadcast address;
usually the broadcast address is a limited broadcast address;
broadcast address = next network address-1 limited broadcast address:
an address with all 1 host bits;
The global broadcast address is: 255.255.255.255

Example: The existing IP address is 172.16.1.100/24, please calculate the broadcast address of this IP address?
Solution: From /24, it can be concluded that the host bit of the IP address occupies 32-24=8 bits. And because the address with all 1s in the host is a broadcast address,
the broadcast address of the IP address is 172.16.1.255/24

(3) Address block address block=2^host bits of a certain byte
Example: The
existing IP address is 172.16.200.100/19, please calculate the address block size of this IP address?
Solution: It can be seen from /19 that the subnet division is performed on the third byte of the IP address, and the host bit of the third byte = 5 bits; therefore, the address block of the IP address = 2^ Host bit of a byte

The first network address: 172.16.0.0/19
The second network address: 172.16.32.0/19 ----This is the network address of
the 172.16.40.100 address The third network address: 172.16.64.0/19
The fourth network Address: 172.16.96.0/19
The fifth network address: 172.16.128.0/19
The sixth network address: 172.16.160.0/19
The seventh network address: 172.16.192.0/19
The eighth network address: 172.16.224.0/ 19

(4) Address space address space=2^host bit example: Existing class A address 10.1.1.1/16, what is the address space of the network segment where this address is located?
Solution: address space = 2^ host bits

Three, routing basis

1. What is routing

Insert picture description here

  • routing:

  • Establish and maintain a routing table to correctly describe the network topology;

  • Data forwarding:

  • Choose the best path;

  • Data forwarding based on routing table;

  • Encapsulate the IP packet and forward it from the interface;

  • Routing table
  • Routing information is stored in the routing table
  • The routing table is the basis for the router to forward data;
  • View routing table: display ip routing-table
    IP routing table

2. How to generate routing table

  • Direct route

  • Directly connected neighbor routing device identified through the interface

  • Through the interface IP, the physical layer and data link layer of the interface UP

  • Static routing

  • Manually configured as one-way using static routing commands

  • Dynamic routing

  • Learning through dynamic routing protocols

  • RIP、OSPF、IS-IS、EIGRP、BGP

3. Routing priority

  1. Administrative distance is used to define the priority of routing sources
  2. Value range: integer value from 0 to 255
  3. The lower the AD value, the higher the priority of the routing source

4. Routing metric

  • The metric value refers to the value used by the routing protocol to allocate the routing cost to the remote network
  • For the same routing protocol, when there are multiple paths leading to the same destination path, the routing protocol uses the metric value to determine the best path
  • The lower the metric, the more priority the path
  • Different routing protocols have different methods for calculating metric values ​​and are not comparable
  • It can be modified artificially as needed to affect routing selection

5. Route optimization

There may be multiple routing sources and multiple paths to the same target network

  • Same network number, same subnet mask
  • Only the best path will enter the routing table routing principle

Routing principle

  • The smaller the management distance, the more priority
  • The smaller the metric, the better

6. Router working principle
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
7. Static routing
(1) Features:

  • The routing table is manually set
  • Unless the network administrator intervenes, static routing will not change
  • The formation of the routing table does not require network resources

Applicable environment: generally used in networks with small network scale and fixed topology;
(2) Static routing configuration
Insert picture description here
8. Default routing
(1) Features: Among all routing types, the default route has the lowest priority.
Applicable environment: general application In the end network with only one exit or as a supplement to other routes
(2) Default route configuration
Insert picture description here

Four, exchange basis

1. The concept of vlan

Concept: Virtual Local Area Network is a technology that realizes virtual work groups by dividing the devices in the local area network logically rather than physically into individual network segments.
Role: VLAN is used to isolate the broadcast domain, and can subdivide a large broadcast domain into multiple small broadcast domains. Each vlan is an independent broadcast domain.

2.vlan type

VLAN is divided into static vlan and dynamic vlan, and the common VLAN division methods are as follows:
(1) port-based vlan ------ static vlan
(2) MAC address-based vlan-dynamic vlan ( 3) Protocol-based vlan---------dynamic vlan

Port types; Huawei equipment includes the following types of ports:
(1) access—used to connect to PCs, routers or other terminal devices, only allowing traffic of .1 vlan to pass through;
(2) trunk port-used for switches The interconnection can filter the lan traffic; or the purpose of the trunk port.
(3) Hybrid port-one needs to configure PVID and Nlan ID, which can realize access port or trunk port;

3.vlan configuration
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44756468/article/details/107272333