1. Overview

在本教程中we’ll discuss the IP address and port in networking.我们将介绍它们之间的一些关键差异。

2. IP Address

The full form of IP is an Internet protocol.A computer connected to the Internet can send and receive information from any other networking devices using an IP address。The main purpose of the IP address is to enable communication.

All devices connected to the internet require a unique IP address. With the increase of networking devices, there is a requirement for billions of IP addresses. EitherIPv4 or IPv6fulfills this requirement.

The first version of IP is IPv\mathsf{4}它使用一个\mathbf{32}-bit addressing scheme allowing to store\mathbf{2^{32}}addresseswhich are more than4十亿个地址。

在IPV开始时\mathsf{4}addressing, due to the low number of networking devices used in day-to-day life, the Internet users were very less. Most of the networks were private. When the Internet erupted, it became a risk that we might run out of unique IP addresses with IPv\mathsf{4}addressing scheme as it’s limited to32-bit.

IPv6 is the latest version of IP.IPv6 is a 128-bits addressing schemeand offers many features that are not present in IPv\mathsf{4}。We present an IPv6 in hexadecimal format.

These features are built-in security, scoped addresses, auto-configuration, quality of service (QoS), new header format, and larger address space. Most operating systems released since2000直接或间接支持IPv6。

Let’s look at an example of IPv\mathsf{4}and IPv6 address:

IP addresses can be classified into four categories: public, private, static, and dynamic。Public IP address routesoverthe Internet and provides remote access to the computer. The private IP addresses can’t be routed over the Internet and don’t allow traffic from it. These are uses as reserve IP addresses and only work within a local network:

Static IP addresses are assigned to any networking device by互联网服务提供商(ISP), and they can be both IPv\mathsf{4}or IPv6. This type of IP address doesn’t change unless we change the network architecture. TheDynamic Host Configuration Protocol (DHCP)servers allocate the dynamic IP addresses, and they are subject to change:

3. Port Number

In networking, a port is a virtual communication endpoint. Each process in an operating system has a specific port number associated with it.Port numbers make it easy for a computer to identify incoming traffic and send them to the appropriate processes.It’s also a docking point that helps in sharing information over the internet.

In theOSI model, ports are part of the transport layer. All the networking devices support ports. We use different port numbers in networking to determine the correct protocol to which the OS forwards the incoming traffic. For example, all incomingHypertext Transfer Protocol (HTTP)traffic goes to port\mathsf{80}

The primary purpose of a port is to help a computer understand incoming traffic and send them.Suppose Sam wants to send an MP3 file to Mike. Sam uses theFile Transfer Protocol (FTP)把迈克的MP3文件。现在让我们假设that after receiving Sam’s file, Mike’s computer doesn’t identify the MP3 file and sends it to an email application.

在这种情况下,电子邮件应用程序将无法打开MP3文件。但是山姆使用端口\ Mathsf {21}allotted to FTP while transferring the MP3 file. Hence Mike’s computer will identify the file using the port number used here and send it to the appropriate process. Also, parallel Mike can load HTTP webpages on his computer that uses port number\mathsf{80}

In a modern-day computer,\mathbf{65,535}possible port numbers are available.Some of the popular and commonly used port numbers are:\mathsf{20}and\ Mathsf {21}for FTP,\mathsf{22}for固定外壳(SSH),\mathsf{23}forTelnet,\mathsf{25}for简单邮件传输协议(SMTP),\mathsf{53}forDomain Name System (DNS)etc.

Let’s look at an example.Here a client computer is trying to create a virtual connection with the server using the port number\mathsf{23}。telnet使用端口号\mathsf{23}, a protocol used to establish a remote connection over aTCP/IPconnection. As soon as the request reaches the server and the server identifies the port number\mathsf{23}, it stars a telnet connection:

4. IP Address vs. Port Number

We now know the basics of IP address and port.Let’s see the differences between an IP address and a port:

Rendered by QuickLaTeX.com

5. Conclusion

在本教程中we learned the IP address and port in detail. We also presented some significant differences between an IP address and a port number.

guest
0Comments
Inline Feedbacks
View all comments