Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
5 tuple

By sonovel in sonovel's Diary
Tue Aug 06, 2002 at 12:27:24 PM EST
Tags: (all tags)

TCP/IP connections are the most common method of transferring information on the Internet. A TCP/IP connection is a 5 tuple.


Five pieces of information make up each unique bidirectional TCP/IP connection. This 5 tuple must be unique for each connection to allow data to go to and from the right places.

The 5 tuple consists of: protocol type, local address, local port, remote address, remote port.

The protocol type for a TCP/IP connection is TCP/IP.

The local address and remote addresses are the 4 byte address usually written as nnn.nnn.nnn.nnn.

The local and remote ports can be fixed number based on the type of communication, or it may be assigned from unused ports.

So how does this all work?

Let's say my computer wants to talk to K5's web server.

My machine knows its own IP address and looks up K5's IP address using DNS. Assume my IP address is 62.1.1.10 and K5's is 237.43.22.11.

The IP protocol for http is TCP. My web browser knows this.

My web browser also knows to use remote port 80 for http connections. Server listen on this port for incoming connections.

My machine initiates the connection and K5 listens and waits for connections.

So I have four items of the five tuple. To get the last item, my machine will assign a port number out of the list of unused ports that don't correspond to well known services. Say it chooses 23785.

In that case the 5 tuple (protocol, Local Address, Local Port, Remote Address, Remote Port) will be: (TCP, 62.1.1.10, 23785, 237.43.22.11, 80).

While it is active, this 5 tuple will be unique on the entire Internet. Once the connection is no longer used, a new connection could be made using the same 5 tuple.

It doesn't matter if one used Berkeley Sockets, WinSock, or other method to create a TCP/IP connection, they all need those items.

 

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Related Links
o sonovel's Diary


Display: Sort:
5 tuple | 3 comments (3 topical, editorial, 0 hidden)
everything2.org (none / 0) (#1)
by prator on Tue Aug 06, 2002 at 12:38:40 PM EST

This seems more like an http://everything2.org entry than a diary entry.

-prator

5 tuple | 3 comments (3 topical, 0 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest © 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!