web analytics

Ports and Encapsulation – A brief Intro.

Ports

Both TCP and UDP use ports to exchange information with applications. A port is an extension of an address, similar to adding an apartment or room number to a street address. A letter with a street address will arrive at the correct apartment building, but without the apartment number, it will not be delivered to the correct recipient. Ports work in much the same way. A packet can be delivered to the correct IP address, but without the associated port, there is no way to determine which application should act on the packet. Once the ports have been defined, it is possible for the different types of information that are sent to one IP address to then be sent to the appropriate applications. By using ports, a service running on a remote computer can determine what type of information a local client is requesting, can determine the protocol needed to send that information, and maintain
simultaneous communication with a number of different clients.

For example, if a local computer attempts to connect to the website www.osstmm.org, whose IP address is 62.80.122.203, with a web server running on port 80, the local computer would connect to the remote computer using the socket address :
62.80.122.203:80

In order to maintain a level of standardization among the most commonly used ports, IANA has established that the ports numbered from 0 to 1024 are to be used for common services. The remaining ports – up through 65535 – are used for dynamic allocations or particular services.

The most commonly used ports – as assigned by the IANA – are listed here:

Port Assignments:

  • 0 Reserved
  • 1-4 Unassigned
  • 5 rje Remote Job Entry
  • 7 echo Echo
  • 9 discard Discard
  • 11 systat Active Users
  • 13 daytime Daytime
  • 15 netstat Who is Up or NETSTAT
  • 17 qotd Quote of the Day
  • 19 chargen Character Generator
  • 20 ftp-data File Transfer [Default Data]
  • 21 ftp File Transfer [Control]
  • 22 ssh SSH Remote Login Protocol
  • 23 telnet Telnet
  • 25 smtp Simple Mail Transfer
  • 37 time Time
  • 39 rlp Resource Location Protocol
  • 42 nameserver Host Name Server
  • 43 nicname Who Is
  • 53 domain Domain Name Server
  • 67 bootps Bootstrap Protocol Server
  • 68 bootpc Bootstrap Protocol Client
  • 69 tftp Trivial File Transfer
  • 70 gopher Gopher
  • 75 any private dial out service
  • 77 any private RJE service
  • 79 finger Finger
  • 80 www-http World Wide Web HTTP
  • 95 supdup SUPDUP
  • 101 hostname NIC Host Name Server
  • 102 iso-tsap ISO-TSAP Class 0
  • 110 pop3 Post Office Protocol – Version 3
  • 113 auth Authentication Service
  • 117 uucp-path UUCP Path Service
  • 119 nntp Network News Transfer Protocol
  • 123 ntp Network Time Protocol
  • 137 netbios-ns NETBIOS Name Service
  • 138 netbios-dgm NETBIOS Datagram Service
  • 139 netbios-ssn NETBIOS Session Service
  • 140-159 Unassigned
  • 160-223 Reserved

Also refer to the page:

http://www.isecom.info/cgi-local/protocoldb/browse.dsp for more detailed information on ports.

Encapsulation

When a piece of information – an e-mail message, for example – is sent from one computer to another, it is subject to a series of transformations. The application layer generates the data, which is then sent to the transport layer. The transport layer takes this information and adds a header to it. This header contains information, such as the IP addresses of the originating and
recipient computers, that explains what must be done to the data in order to get it to the appropriate destination. The next layer adds yet another header, and so on. This recursive procedure is known as encapsulation. Each layer after the first makes its data an encapsulation of the previous layer’s data, until you arrive at the final layer, in which the actual transmission of data occurs.

When the encapsulated information arrives at its destination, it must then be de-encapsulated. As each layer receives information from the previous layer, it removes the unneeded information contained in the header placed there by the previous layer.

Oneiroi

Learn it, Perfect it, Share it.

Tags: , , , , , , , , , , , , , , , , ,

No comments yet.

Leave a Reply