No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


TCP IP Overview

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
TCP IP Overview

TCP IP Overview


This document describes the concepts and fundamentals of the TCP/IP protocol suite.

Overview of Network Protocols

Computer networks have grown rapidly since the 1960s. To dominate the data communications network, major vendors have launched their own network architecture systems and standards, and produced different hardware and software for their own protocols. The joint efforts of various vendors promoted the rapid development of network technologies and the rapid growth of network device types. However, due to the coexistence of multiple protocols, networks became more and more complicated, and most network devices of different vendors were incompatible and difficult to communicate with each other.

To resolve network compatibility issues and help vendors produce compatible network devices, the International Organization for Standardization (ISO) proposed the Open System Interconnection (OSI) reference model in 1984. The OSI reference model was designed based on the following principles: There are clear boundaries between layers to implement specific functions. The division of layers is beneficial to the formalization of international standard protocols. The number of layers are sufficient to avoid duplication of functions at each layer. Figure 1-1 shows the seven-layer of the OSI reference model.

Figure 1-1 Seven-layer of the OSI reference model

TCP/IP Protocol Suite

The OSI reference model and protocols are complex and so have not been widely used. The Transmission Control Protocol/Internet Protocol (TCP/IP) model has been widely used in practice because of its openness and ease of use. The TCP/IP protocol suite also becomes the mainstream protocols of the Internet.

The hierarchical structure of the TCP/IP protocol suite cannot exactly correspond to the OSI reference model. The TCP/IP protocol suite was originally defined as a hardware-based four-layer architecture: including the application layer, transport layer, Internet layer, and link layer. A five-layer protocol model is adopted to combine the characteristics of the OSI and TCP/IP, as shown in Figure 1-2.

Figure 1-2 Computer network system


TCP is a connection-oriented transport protocol. Applications must establish a TCP connection before using the TCP protocol. After data transmission is complete, the established TCP connection must be released. Communication between application programs is like making a call. You need to dial up to establish a connection before a call, and hang up to release the connection after the call ends.

TCP provides end-to-end reliable services. Each TCP connection has only two endpoints. The data transmitted over a TCP connection is error-free, not lost, not duplicated, and arrives in order. TCP provides functions such as timeout and retransmission management, window management, traffic control, and congestion control to ensure that TCP provides reliable services.

TCP provides full-duplex communication. TCP allows application processes of both communication parties to send data at any time. Both ends of a TCP connection are provided with a send buffer and a receive buffer to temporarily store data transmitted between the two parties. Application programs just need to transmit data to the TCP buffer, and TCP sends the data at a proper time. TCP stores the received data in the buffer. Upper-layer application processes read the data in the buffer at a proper time.

TCP provides stream-oriented services. A stream in TCP refers to a sequence of bytes flowing into or out of a process. The meaning of stream-oriented stream is that although the interaction between an application and TCP is one data block at a time (the size is not equal), TCP regards the data handed over by the application as a series of unstructured byte streams. TCP does not know the meaning of the transmitted byte streams.


To connect a PC to the Internet, you need to apply an IP address from an Internet Service Provider (ISP). An IP address is a numerical label assigned to each device on a computer network. An IPv4 address is a 32-bit binary number, and it is expressed in dotted decimal notation, which helps you memorize and identify it. In dotted decimal notation, an IPv4 address is written as four decimal numbers, one for each byte of the address. For example, the binary IPv4 address 00001010 00000001 00000001 00000010 is written as in dotted decimal notation.

An IPv4 address is divided into two parts:

  1. Network ID (Net-id): identifies a network.
  2. Host ID (Host-id): identifies a host on a network. Network devices with the same network ID are located on the same network, regardless of their physical locations.

IPv4 addresses have the following characteristics:

  1. IP addresses do not reflect any geographical information of hosts. The network ID specifies the network to which a host belongs.
  2. When a host connects to two networks simultaneously, it must have two IP addresses with different network IDs. In this case, the host is called a multihomed host.
  3. Networks allocated with network IDs are in the same class.

IP addresses are classified into five classes to facilitate IP address management and networking, as shown in Figure 1-3.

Figure 1-3 IP addresses of five classes

At present, most IP addresses in use belong to Class A, Class B, or Class C. Class D addresses are multicast addresses and Class E addresses are reserved. The easiest way to determine the class of an IP address is to check the first bits in its network ID. The class fields of Class A, Class B, Class C, Class D, and Class E are binary digits 0, 10, 110, 1110, and 1111 respectively. For details about IP address classification, see RFC 1166.

IP Routing

Routing is a basic concept in an IP network. The basic function of a network is to enable two IP nodes in the network to communicate with each other. The communication is actually a data exchange process. Data exchange requires network devices to help transmit data between two communication nodes. When a router (or another Layer 3 device) receives an IP packet, the router finds the destination IP address in the IP header of the packet, and searches its routing table for a route based on the destination IP address. After it finds an exact matching routing entry, it forwards the packet using the outbound interface or next-hop IP address indicated by the routing entry. This process is called routing.

Each router maintains a routing table locally. The routing table contains the routing entries obtained by the router using various methods. Each routing entry consists of the route prefix (destination network ID of the route), route origin, outbound interface or next-hop IP address, priority, and cost. Routers obtain routing entries through direct, static, or dynamic routing protocols and maintain their own routing tables. Routing tables are the basis for data forwarding of each routing-supporting device.

Routing protocols are classified into interior routing protocol and exterior routing protocol based on where the protocols are running, as shown in Figure 1-4:

  • Interior routing protocol: runs within an AS.
  • Exterior routing protocol: runs between different ASs.
Figure 1-4 Interior routing protocols and exterior routing protocols

Routing protocols are classified into distance-vector routing protocol and link-state routing protocol based on the routing algorithms, as shown in Figure 1-5:

  • Distance-vector routing protocol: includes RIP and Border Gateway Protocol (BGP). BGP is also called a path-vector protocol.
  • Link-state routing protocol: includes Open Shortest Path First (OSPF) and Intermediate System-to-Intermediate System (IS-IS).
Figure 1-5 Distance-vector routing protocols and link-state routing protocols

Interior Routing Protocols


RIP is a distance-vector algorithm that measures the distance to a destination network based on the hop count. It is a simple Interior Gateway Protocol (IGP). RIP exchanges routing information using User Datagram Protocol (UDP) packets through UDP port 520. Two RIP versions are used in IPv4 networks: RIP version 1 (RIP-1) and RIP version 2 (RIP-2). RIP-2 is an extension to RIP-1.

RIP has been widely used on small-sized networks to discover routes and generate routing information. It is easier to configure, maintain, and implement than OSPF and IS-IS. RIP has a limit of 15 hops and is not suitable for complex or large networks.


OSPF is a link-state IGP that works within a single AS. OSPF Version 2, as defined in RFC 2328, is designed for IPv4. OSPF Version 3, as defined in RFC 2740, is designed for IPv6.

In an OSPF network, each router generates link state advertisements (LSAs) based on its surrounding network topology and transmits the LSAs in update packets to other routers in the network. RIP devices exchange routes, whereas OSPF devices exchange link state information. That is, in RIP, routers select routes based on routing information of neighbors, without checking whether the information transmitted by neighbors is correct. In OSPF, routers calculate routes by themselves and select routes based on LSAs.

Each router learns about the whole network topology based on its link state database (LSDB). Each router collects LSAs sent from other routers, and all LSAs form the LSDB of this router. An LSA describes the surrounding network topology of a router, whereas an LSDB describes the network topology of the entire AS. A router transforms its LSDB into a weighted and directed graph, which reflects the topology of the entire AS. When the network topology is stable, all routers in the same area have the same graph.


IS-IS is an IGP that runs within an AS. It is also a link-state routing protocol, using the shortest path first (SPF) algorithm to calculate routes.

IS-IS is a dynamic routing protocol initially designed by the ISO for its Connectionless Network Protocol (CLNP).

To support IP routing, the Internet Engineering Task Force (IETF) extended and modified IS-IS in RFC 1195. This modification enables IS-IS to apply to TCP/IP and OSI environments. This type of IS-IS is called Integrated IS-IS or Dual IS-IS.

Exterior Routing Protocols


A network is divided into different ASs to facilitate network management. In 1982, the Exterior Gateway Protocol (EGP) was defined to dynamically exchange routing information between ASs. EGP advertises only reachable routes and does not select optimal routes or prevent routing loops. Therefore, EGP cannot meet network management requirements.


BGP is a path-vector routing protocol that allows devices between ASs to communicate with each other and selects optimal routes. BGP-1 (defined in RFC 1105), BGP-2 (defined in RFC 1163), and BGP-3 (defined in RFC 1267) are three earlier versions of BGP. BGP-4 (defined in RFC 1771) has been used since 1994. Since 2006, unicast IPv4 networks have been using BGP-4 defined in RFC 4271, and other networks (such as IPv6 networks) have been using Multiprotocol BGP (MP-BGP) defined in RFC 4760.

MP-BGP is an extension of BGP-4 and applies to different networks, but the original message exchange and routing mechanisms of BGP-4 remain unchanged. MP-BGP applications on IPv6 unicast and IPv4 multicast networks are called BGP4+ and Multicast BGP (MBGP) respectively.

Updated: 2019-07-03

Document ID: EDOC1100092155

Views: 743

Downloads: 102

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Previous Next