Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Networking / Difference Between Socket and Port

Difference Between Socket and Port

June 27, 2011 Posted by Indika

Socket vs Port

In the context of computer networking, a socket is an end point of a bidirectional communication that occurs in a network that is based on the internet protocol. Sockets will distribute the data packets that are coming through the communication channel to the correct application. This is done using the information such as IP address and port number. In general a (software) port is a logical data connection that can be used to exchange data. On the internet TCP and UDP ports are used to exchange data between computers and these are the most widely used ports.

What is a Socket?

A socket is an end point of a bidirectional communication that occurs in a computer network that is based on the internet protocol. Sockets will distribute the data packets that are coming through the communication channel to the correct application. Operating system maps each socket to a process or a thread that communicates. There are two types of sockets called active sockets and passive sockets. An active socket is a socket that is connected to another active socket through a data connection that is open. Active sockets at both ends of the communication channel will be destroyed when the connection is closed. A passive socket is not participating in a connection, but a socket that is waiting for an incoming connection. When a passive socket is connected it will generate a new active socket. An internet socket is identified by the address of the local socket (local IP address and port number), address of the remote socket and the transport protocol (e.g. TCP, UDP).

What is a Port?

A port is a logical data connection that can be used to exchange data without the use of a temporary file or storage. On the internet TCP and UDP ports are used to exchange data between computers and these are the most widely used ports. Port is identified using a number associated with the port called the port number, the IP address associated with the port and the transportation protocol. Set of port numbers are generally reserved in a host computer for specific types of services. Port scanning is the process of attempting to connect to a set of ports that are in a sequence. In general, port scanning is considered as a malicious attempt. The system administrators conduct it to check for vulnerabilities in a system.

What is the difference between Socket and Port?

A socket is an end point of a bidirectional communication that occurs in a computer network that is based on the Internet protocol, whereas a port is a logical data connection that can be used to exchange data without the use of a temporary file or storage. A socket is associated with a port and there can be multiple sockets associated with a port. There can be a single passive socket associated with a port that is waiting for incoming connections. Furthermore, there can be multiple active sockets that correspond to connections that are open in that port.

Related posts:

Difference Between IP and Port Difference Between Harbour and Port Difference Between NAT and NAPT Difference Between VLAN and VPN Difference Between Flooding and Broadcasting

Filed Under: Networking Tagged With: active socket, active sockets, internet socket, IP address, passive socket, passive sockets, Port, port number, Port scanning, ports, socket, sockets, TCP port, UDP port

About the Author: Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Leave a Reply Cancel reply

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Radiation and Irradiation

Difference Between Bull and Steer

Difference Between printf and fprintf

Difference Between printf and fprintf

Difference Between Lycra and Neoprene

Difference Between Lycra and Neoprene

Difference Between Endocarditis and Pericarditis

Latest Posts

  • Difference Between Alcoholic and Non-alcoholic Fatty Liver
  • Difference Between Neostigmine and Physostigmine
  • Difference Between Resonance and π Conjugation
  • Difference Between Equational Division and Reduction Division
  • Difference Between Electron Affinity and Electron Gain Enthalpy
  • Difference Between Systemic and Opportunistic Mycoses
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018 Difference Between. All rights reserved. Terms of Use and Privacy Policy: Legal.