Establishing and Terminating Tcp Connections Establishing Connections

Subnetting

In many cases, a network can be divided into multiple subnets, in which case subnetid domains can be added to identify the subnets. The subnetid domain is derived from the hostid domain, specifically for the 3 classes A, B, C as follows:


Netid

Subnet id

hostid

Maybe you are interested!

Establishing and Terminating Tcp Connections Establishing Connections

Class A


Netid

Subnet id

hostid

0 7 8 15 16 23 24 31


0 7 8 15 16 23 24 26 27 31


Class B


Netid

Subnet id

hostid

Class C


Figure 2.4: Adding subnetid region

Refer to the textbook "Design and construction of LAN and WAN networks" for more details.

1.4. IP data packet structure

IP is a protocol that provides “connectionless” communication services. IP data packets are defined as datagrams. Each datagram has a header containing the information necessary to transfer the data (for example, the IP address of the destination station). If the destination IP address is the address of a station on the same IP network as the source station, the data packets will be forwarded directly to the destination; if the destination IP address is not on the same IP network as the source station, the data packets will be sent to a transit machine, an IP gateway, for forwarding. An IP gateway is an IP network device that is responsible for transferring IP data packets between two different IP networks.

Bit 0 Bit 31


VERS

HLEN

Service type

Total length

Identification

Flags

Fragment offset

Time to live




Destination IP address

IP options (maybe none)

Padding

IP datagram data (up to 65535 bytes)

Protocol

Source IP address

Header checksum

Header


Figure 2.5: TCPIP data packet structure

1.5. Fragmentation and reassembly of IP packets

An IP datagram has a maximum length of 65536 bytes, while most data link layers only support data frames that are several times smaller than the maximum IP datagram size (for example, the maximum MTU length of an Ethernet datagram is 1500 bytes). Therefore, it is necessary to have a fragmentation mechanism at transmission and reassembly at reception for IP datagrams.

Original IP packet 1. fragment 2.fragment


04 05 00

2000

1 1 1 1

0

0 0 0


05


06


checksum

128.82.24.12

192.12.2.5

Data 1980 byte

04 05 00

1500

1 1 1 1

1

0 0 0


05


06


checksum

128.82.24.12

192.12.2.5

Data 1480 byte

04 05 00

520

1 1 1 1

0

0 0 0


05


06


checksum

128.82.24.12

192.12.2.5

Data 500 byte

Figure 2.6: Principle of data packet fragmentation


P uses the MF flag (lower 3 bits of the Flags field in the IP packet header) and the Flagment offset field of the fragmented IP packet to identify the IP packet as a fragment and the position of this fragment in the original IP packet. Packets in the same fragmentation sequence have the same field. The MF flag is 1 if it is the first packet in the fragmentation sequence and 0 if it is the last packet in the fragmented packet.


1.6. IP Routing

There are two types of routing:

- Direct routing: Direct routing is the determination of a path between two workstations in the same physical network.

- Indirect routing. Indirect routing is the determination of a path between two workstations that are not on the same physical network and therefore, communication between them must be done through intermediate stations called gateways.

To check whether the destination station is on the same physical network as the source station, the sender must extract the network address from the IP address. If the two addresses have the same network address, the datagram will be transmitted directly; otherwise, a gateway must be identified, through which the datagrams are forwarded.



Host A1 Host C1



Gateway

Gateway

Application Transport

Application Transport

Internet Network

Internet Network

Access

Internet Network

Internet Network

Access


Network A Network B Network C


Figure 2.7: Routing between two systems


2. Some control protocols

2.1. ICMP protocol

ICMP (Internet Control Message Protocol) is an IP-level control protocol used to exchange data flow control information, error messages, and other status information of the TCP/IP protocol suite. For example:

- Flow control.

- Error message: for example "Destination Unreachable".

- Redirect routes: redirect packets

- Check remote stations: echo packet

An example format of an ICMP redirect message is as follows:


0

7 8

15 16

31

type (5)

Code(0-3)

Checksum

Default Router IP Address

IP header (including options) and the first 8 bytes of the source IP data packet


2.2. ARP protocol and RARP protocol


On a local network, two stations can only communicate with each other if they know each other's physical address. So the problem is to map between the IP address (32 bits) and the physical address (48 bits) of a station. The ARP (Address Resolution Protocol) protocol has been built to convert from IP address to physical address when necessary. Conversely, the RARP (Reverse Address

Resolution Protocol) is used to convert physical addresses to IP addresses. The ARP and RARP protocols are not part of IP, but IP will use them when needed.


3. Transport Layer Protocol

3.1. TCP Protocol


TCP (Transmission Control Protocol) is a “connection-oriented” protocol, meaning that a (logical) connection needs to be established between a pair of TCP entities before they can exchange data with each other.

TCP provides secure data transmission between hosts in a network. It also provides additional functions to check the accuracy of incoming data and includes resending data when errors occur. TCP provides the following main functions:

1. Establish, maintain, and terminate links between two processes.

2. Deliver packets reliably.

3. Sequencing of data packets for reliable data transmission.

4. Allow error control.

5. Provide the ability to multiplex different processes between a given source and destination station through the use of ports.

6. Data transmission uses full-duplex mechanism.

3.1.1 TCP data packet structure

0 31


Source port

Destination port

Sequence number

Acknowledgement number

Data Offset

Reserved

UR

G

AC

K

PS

H

RS

T

SY

N

FI

N


Window

Checksum

Urgent pointer

Options

Padding

TCP data


You can refer to the detailed content of the fields in the textbook "Design and construction of LAN and WAN networks"

An application process in a host accesses the services provided by TCP through a port as follows:

A port associated with an IP address forms a single socket in the internetwork. TCP is provided by a logical connection between a pair of sockets. A socket can participate in multiple connections with different remote sockets. Before data can be transmitted between two hosts, a TCP connection must be established between them and the connection must be released when the data transmission is completed. As in other protocols, upper-layer entities use TCP through service primitives, also known as function calls.


3.1.2 Establishing and terminating TCP connections Establishing connections

TCP connection establishment is performed on the basis of the three-way handshake method (Tree-way Handsake) shown below. The connection request is always initiated by the station process, by sending a TCP packet with the SYN flag=1 and containing the client's initialization value of the ISN sequence number. This ISN value is an unsigned 4-byte number and is incremented each time a connection is requested (this value returns to 0 when it reaches the value

2 32 ). This SYN message also contains the TCP port number of the service software that the station process wants to connect to (step 1).

Each TCP connection instance has a new ISN value that is incremented over time. Since a TCP connection with the same port number and IP address is reused multiple times, changing the INS value prevents connections from reusing stale data that is still transmitted from an old connection with the same connection address.

When the TCP entity of the service software receives the SYN message, it sends back a SYN packet with its ISN value and sets the ACK flag=1 in case it is ready to accept the connection. This message also contains the ISN value of the station process in case of a receive sequence number to indicate that the service entity has received the ISN value of the station process (step 2).

The station process responds to the service entity's SYN packet with a final ACK response message. In this way, the TCP entities reliably exchange each other's ISN values ​​and can begin exchanging data. None of the messages in the previous three steps contain any data; all the information exchanged is contained in the TCP message header (step 3).


TCP_A TCP_B

TCP_A TCP_B


Syn, Seq=x


Syn, Seq=y

Ack(x+1)

Ack(y+1)

Fin, Seq=x Ack(x+1)


Fin, Seq=y,



a) establish connection


Ack(x+1) Ack(y+1)

b) End of connection


Figure 2.8: 3-step connection process


End of connection

When there is a need to terminate the connection, the TCP entity, for example A, sends a connection termination request with FIN=1. Since the TCP connection is full-duplex, even though it receives A's connection termination request (A notifies that it has run out of data to send), entity B can still continue transmitting data until B has no more data to send and notifies A with its own connection termination request with FIN=1. When the TCP entity has received the FIN message and after sending its own FIN message, the TCP connection is actually terminated.


PART II: NETWORK ADMINISTRATION


Network administration is defined as the network management tasks that include providing support services, ensuring the network operates effectively, and ensuring the quality of the network provided meets the set targets.

System administration is defined as the work of providing support services, ensuring reliability, improving system performance, and ensuring the quality of services provided on the system meets set standards.

A general definition of network administration is difficult because of its broad scope. Network administration in the sense of computer networks can be broadly understood as the set of network administration and system administration.


Network administration can be summarized as including the following tasks:

Configuration and network resource management: Includes configuration control management, resource allocation management for different users. Specific management tasks can be found in documents and textbooks on Windows, Linux, Novell Netware system management...

User and network service management: Includes user management tasks on the system, on the network and ensuring the service provided is highly reliable, quality is guaranteed according to the set criteria. You can refer to documents, textbooks on Windows system management, Novell Netware, Linux, Unix, basic email service management, DNS...

Network performance and operation management: Includes the tasks of managing and monitoring network operations, ensuring that devices, systems, and services on the network operate stably and effectively. Network performance management and monitoring tasks allow administrators to synthesize and forecast network and service development, weaknesses, and strengths of the entire network, systems, and services, while helping to exploit the entire network system with the highest efficiency. You can refer to documents and textbooks on network management systems NMS, HP Openview, Sunet Manager, or textbooks on improving system performance (performance tuning).

Network security and safety management: Includes the management and monitoring of networks and systems to ensure the prevention of unauthorized access, sabotage of systems and services, or the goal of stealing important information of organizations and companies or changing content provided online with bad intentions. Preventing and stopping the spread of computer viruses, attack methods such as DoS that paralyze network operations or

Services are also an extremely important part of network security and safety management. In particular, now that the need to connect to the Internet has become essential, ensuring security and safety is a top priority, especially for agencies that need to keep information content highly confidential (banks, archives, electronic newspapers, key economic groups, etc.).

Part 2 of this course will focus on in-depth research on some of the most basic and common knowledge and skills in network administration. However, the content presented in part 2 will not cover all the content outlined above due to the complexity of each content as well as the time limit for compilation. With the goal of providing the most common skills to help students quickly access network administration to undertake the tasks assigned by agencies and companies. Part 2 of the course will include:

- Overview of routers on the network

- DNS domain name system

- Remote access services and proxy services

- Firewall and system security

Students can also refer to additional knowledge about network administration with textbooks on local area networks, textbooks on electronic mail, textbooks on Windows, Linux, Unix operating systems, which are compiled in the set of textbooks serving training for project 112.

Comment


Agree Privacy Policy *