<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learn-Networking.com &#187; tcp</title>
	<atom:link href="http://learn-networking.com/tag/tcp/feed" rel="self" type="application/rss+xml" />
	<link>http://learn-networking.com</link>
	<description>Where 127.0.0.1 is Home.</description>
	<lastBuildDate>Sat, 27 Nov 2010 22:11:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How the Application Layer Works</title>
		<link>http://learn-networking.com/tcp-ip/how-the-application-layer-works</link>
		<comments>http://learn-networking.com/tcp-ip/how-the-application-layer-works#comments</comments>
		<pubDate>Sun, 27 Jan 2008 21:45:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[application layer]]></category>
		<category><![CDATA[arp]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[hostname]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tcp/ip]]></category>
		<category><![CDATA[tftp]]></category>
		<category><![CDATA[tracert]]></category>
		<category><![CDATA[UDP]]></category>
		<category><![CDATA[whois]]></category>

		<guid isPermaLink="false">http://learn-networking.com/blog/tcp-ip/how-the-application-layer-works</guid>
		<description><![CDATA[In the previous section we reviewed several aspects of the Transport Layer. We learned a great deal of information; covering sockets, ports, TCP, UDP, segments, and datagrams. Now we will take a look at the fourth and final layer of the TCP/IP stack: the Application Layer. What Does The Application Layer Do? A lot of [...]]]></description>
			<content:encoded><![CDATA[<p class="notifytext">In the previous section we reviewed several aspects of the Transport Layer. We learned a great deal of information; covering sockets, ports, TCP, UDP, segments, and datagrams. Now we will take a look at the fourth and final layer of the TCP/IP stack: the Application Layer.</p>
<h3>What Does The Application Layer Do?</h3>
<p class="white">A lot of newcomers to TCP/IP wonder why an Application Layer is needed, since the Transport Layer handles a lot of interfacing between the network and applications. While this is true, the Application Layer focuses more on network services, APIs, utilities, and operating system environments.</p>
<p>If you know the TCP/IP stack and OSI model well enough, you’ll know that there are three OSI model layers that correspond to the TCP/IP Application Layer.</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/osi-tcp-model.jpg" alt="tcp osi model" /></p>
<p>By breaking the TCP/IP Application Layer into three separate layers, we can better understand what responsibilities the Application Layer actually has.</p>
<p><strong>The OSI Equivalent of the TCP/IP Application Layer</strong></p>
<ul>
<hr />
<li> <strong>1. Application Layer -</strong> The seventh OSI model layer (which shouldn’t be confused with the TCP/IP stack’s Application Layer). It supports network access, as well as provides services for user applications.</li>
<p></p>
<li><strong>2. Presentation Layer -</strong> The Sixth OSI model layer is the Presentation Layer. It translates data into a format that can be read by many platforms. With all the different operating systems, programs, and protocols floating around, this is a good feature to have. It also has support for security encryption and data compression.</li>
<p></p>
<li><strong>3. Session Layer -</strong> The fifth layer of the OSI model is the Session Layer. It manages communication between applications on a network, and is usually used particularly for streaming media or using web conferencing.</li>
<hr /></ul>
<p>To better grasp the concepts of the Application Layer, we’ll take a look at a few examples of the Application Layer in action.</p>
<h3>Application Layer APIs</h3>
<p class="white">If you aren’t hip on the nerdy lingo- don’t worry: an API simply stands for Application Programming Interface. An API is just a collection of functions that allows programs to access an internal environment.</p>
<p>A good example of an API is DirectX. If you’ve ever run a multimedia application and used Windows at the same time, odds are you have come into contact with DirectX. DirectX is made up of many different components that allow programmers to create multimedia applications (such as video games).</p>
<p>There are many types of APIs to delve into. You may have heard of NetBIOS, Winsock, or WinAPI among others. The world of APIs has also extended to web services. You may have heard of a Google API, for instance. In this case Google allows developers to use its internal functions, yet also keeps Google’s internal code safe from prying eyes. (Otherwise, there would be a few security concerns on Google’s part.)</p>
<h3>Network Services</h3>
<p class="white">The Application Layer handles network services; most notably file and printing, name resolution, and redirector services.</p>
<p>Name resolution is the process of mapping an IP address to a human-readable name. You may be familiar with the name Google more so than the IP address of Google. Without name resolution, we would have to remember four octets of numbers for each website we wanted to visit- not very friendly is it?</p>
<p>A redirector, otherwise known as a requester, is a service that is largely taken for granted. It is a handy little service that looks at requests a user may make: if it can be fulfilled locally, it is done so. If the request requires a redirection to another computer, then the request is forwarded onto another machine. This enables users to access network resources just like they were an integral part of the local system. A user could browse files on another computer just like they were located on the local computer- obviously redirector services are fairly powerful.</p>
<p>Lastly we have file and print services. If a computer needs to access a file server or a printer, these services will allow the computer to do so. It is fairly self-explanatory, but worth reviewing nonetheless.</p>
<h3>Network Utilities</h3>
<p class="white">This is where most people have experience- within the network utilities section of the Application Layer. Every time you use a Ping, Arp, or Traceroute command, you are taking full advantage of the Application Layer.</p>
<p>It’s quite convenient that the Application Layer is located on the top of the TCP/IP stack. We can send a Ping and, if successful, can verify that the TCP/IP stack is successfully functioning. It’s a good idea to commit each utility to memory, as they are very useful for maintaining, configuring, and troubleshooting networks. Listed below are seven of the most used utilities.</p>
<p><strong>Seven TCP Utilities Explained</strong></p>
<ul>
<hr />
<li><strong>1. ARP -</strong> Arp stands for Address Resolution Protocol. It is used to map an IP address to a physical address found on your NIC card. Using this command can tell us what physical address belongs to which IP address.</li>
<p></p>
<li><strong>2. Netstat -</strong> Netstat is a handy tool that displays local and remote connections to the computer. It displays IP addresses, ports, protocol being used, and the status of the connection.</li>
<p></p>
<li><strong>3. Ping -</strong> Ping is a simple diagnostic tool that can check for connectivity between two points on a network. It is one of the most used TCP/IP utilities when setting up a network or changing network settings.</li>
<p></p>
<li><strong>4. TraceRT -</strong> Tracert, or traceroute, is a command that will show the path that packets of data take while being sent. It’s handy for checking to see where a possible network failure lies, or even for ensuring that data packets are taking the fastest route possible on a network.</li>
<p></p>
<li><strong>5. FTP / TFTP -</strong> FTP and TFTP are both used for transferring files. It is important to note that FTP is a TCP utility, while TFTP is a UDP utility. TFTP tends to be less secure than FTP, and is generally only used for transferring non-confidential files over a network when speed is concerned.</li>
<p></p>
<li><strong>6. Hostname -</strong> Hostname is a simple command that displays the hostname of the current computer. Simple, yet effective.</li>
<p></p>
<li><strong>7. Whois -</strong> Whois information is just like an online phonebook. It shows the contact information for owners of a particular domain. By using a Whois search, you will find that Google is based in California.</li>
<hr /></ul>
<h3>Closing Comments</h3>
<p>The Application Layer isn’t as exciting as the others. We don’t really have much physical interaction with the Application layer, and most of the fun applies to developers and geeks only.</p>
<p>There is still much to learn- TCP/IP is just the very beginning of the networking world. But with this lesson on the final TCP/IP layer complete, you can now say that you have a much better understanding of the TCP/IP model. (And networking in general.)</p>
<img src="http://learn-networking.com/learn-networking.com/?ak_action=api_record_view&id=57&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://learn-networking.com/tcp-ip/how-the-application-layer-works/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How the Transport Layer Works</title>
		<link>http://learn-networking.com/featured/how-the-transport-layer-works</link>
		<comments>http://learn-networking.com/featured/how-the-transport-layer-works#comments</comments>
		<pubDate>Sun, 27 Jan 2008 21:26:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[segment]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tcp/ip]]></category>
		<category><![CDATA[transport layer]]></category>
		<category><![CDATA[UDP]]></category>

		<guid isPermaLink="false">http://learn-networking.com/blog/network-design/how-the-transport-layer-works</guid>
		<description><![CDATA[In the previous section we took a look at the Internet Layer. We took apart the IP header information, reviewed IP addresses and routing information, and briefly discussed ARP and RARP technologies. Next in line we have the Transport layer- the layer responsible for actually getting the data packets to a specific location. When we [...]]]></description>
			<content:encoded><![CDATA[<p class="notifytext">In the previous section we took a look at the Internet Layer. We took apart the IP header information, reviewed IP addresses and routing information, and briefly discussed ARP and RARP technologies.</p>
<p>Next in line we have the Transport layer- the layer responsible for actually getting the data packets to a specific location. When we receive email, we want to open it with our email program- not anything else. So how does a computer know exactly where to route data to appropriate programs, all while dealing with multiple connections?</p>
<h3>The Difference between TCP and UDP</h3>
<p class="white">There are two protocols that are primarily used to transport data: TCP and UDP. TCP stands for transmission control protocol. It is the more common of the two, since it allows for much more error checking functionality and stability. UDP, or User Datagram Protocol, lacks extensive error checking- but is considered to be much faster than TCP as a result.</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/tcp-versus-udp.jpg" alt="tcp udp" /></p>
<p>Since TCP guarantees the delivery of data over a network we call it a connection-oriented protocol. If in the event that data isn’t sent correctly, the sending computer will be notified and will resend the information. This is compared to UDP, which doesn’t require that data has been received correctly. Likewise, we call UDP a connectionless protocol.</p>
<h3>How Do Transport Protocols Work?</h3>
<p class="white">We mentioned earlier that a transport protocol can have simultaneous connections to a computer- yet the receiving computer still knows where each data packet should be sent. This is accomplished through ports and sockets.</p>
<p class="white">A port is simply an internal address that acts as a pathway to control data flow. Since we need each port to be specific to a certain application, there are thousands of ports for use. If you are using the internet, for instance, data is being routed through TCP port 80. This port is called the HTTP port. Ports that have specific purposes (such as the HTTP port) are also known as well-known ports. (And in case you were wondering, there are over 65,535 ports to experiment with.)</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/telnet-data.jpg" alt="telnet" /></p>
<p>So now we know two things. First, the IP address is used to route the data to a specific computer. Next, the port number is used to tell the receiving computer what kind of application should handle it. But to actually accomplish both of these tasks, we use what is called a socket. A socket is simply an address formed by using the IP address and then tacking on the port number at the end.</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/socket-tcp.jpg" alt="telnet" /></p>
<h3>Practical Uses of the Socket</h3>
<p class="white">So what good is a socket? For one thing, multiplexing and demultiplexing is made possible. When you are running multiple programs that are communicating with other computers, you are making use of both of these technologies.</p>
<p class="white">Let’s look at a practical example. You are running a telnet server in which multiple computers are connected to. Each computer uses a socket address to tell the server which computer and which port the data is coming from. If each computer broadcasted at the same time, there may be a jam at the transport layer. We use multiplexing in this case to combine all incoming data into one stream.</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/multiplexing.jpg" alt="multiplex" /></p>
<p>Demultiplexing is very similar to multiplexing, except that it works in reverse. Instead of taking multiple streams of input data and outputting a single stream of data, demultiplexing involves receiving a single stream of input and delivering it to multiple outputs. This is handy for separating multiplexed signals. You may see demultiplexing referred to as “Demuxing.”</p>
<h3>The Anatomy of a TCP Segment</h3>
<p class="white">So now we know how data is routed, but what is the data made up of? As we learned in previous sections, we call the data at the Transport level of the TCP protocol a segment.</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/transport-segment.jpg" alt="transport segment" /></p>
<p><strong>TCP Segments Explained</strong></p>
<ul>
<hr />
<li><strong>1. Source Port -</strong> A 16-bit field that specifies which port number the data segment originated from on the source machine.</li>
<p></p>
<li><strong>2. Destination Port -</strong> A 16-bit field that specifies which port number the data segment is destined for on the receiving machine.</li>
<p></p>
<li><strong>3. Sequence Number -</strong> A 32-bit field that specifies which sequence number the particular segment of information is assigned. The sequence number is used to number packets of information so that they may be counted on the receiving side- guaranteeing a successful and complete delivery of information.</li>
<p></p>
<li><strong>4. Acknowledgment Number -</strong> A 32 bit field that specifies whether or not a segment was received correctly. The acknowledgment number is always one higher than the sequence number, since the receiving computer is expecting the next segment.</li>
<p></p>
<li><strong>5. Data Offset &#8211; </strong>A 4-bit field that tells the receiving computer how long the header is, and where the data actually begins.</li>
<p></p>
<li><strong>6. Reserved -</strong> A 6-bit field that is reserved for future use. Currently this field is represented as all zeroes. In the future, it may be likely that TCP will make use of this space for some reason or another.</li>
<p></p>
<li><strong>7. URG -</strong> A 1-bit control flag that stands for urgent. If the value is 1, the information is urgent and should be dealt with accordingly.</li>
<p></p>
<li><strong>8. ACK -</strong> A 1-bit control flag that, if set to 1, indicates that the Acknowledgment Number field is significant.</li>
<p></p>
<li><strong>9. PSH -</strong> A 1-bit control flag that stands for push. If set to 1, all the information sent so far is sent to the receiving application.</li>
<p></p>
<li><strong>10. RST -</strong> 1-bit control flag that stands for reset. If set to 1, the connection is reset.</li>
<p></p>
<li><strong>11. SYN -</strong> A 1-bit control flag that stands for synchronize. If set to 1, then a sequence of numbers will be used to sort information packets. This also marks the beginning of a connection.</li>
<p></p>
<li><strong>12. FIN -</strong> A 1-bit control flag that stands for finished. It also closes a connection, and indicates that there is no more data to be sent.</li>
<p></p>
<li><strong>13. Window -</strong> A 16-bit field that is used for flow control. It indicates that a range of sequence numbers past the last acknowledged sequence number do not require further acknowledgment.</li>
<p></p>
<li><strong>14. Checksum  -</strong> A 16-bit field that checks segment integrity. A calculation is done on both the sending and receiving computer. This calculation is based on the segment’s information, so we can use it to check and see if the packet is indeed the same being received as it was sent.</li>
<p></p>
<li><strong>15. Urgent Pointer -</strong> A 16-bit field that indicates the beginning of urgent information. Specifically, it points to a sequence number.</li>
<p></p>
<li><strong>16. Options -</strong> A field that may be used to set various optional settings.</li>
<p></p>
<li><strong>17. Padding -</strong> A spacer used to offset the Options field. Since every row must equal 32 bits, the Padding field must add to the Options field to equal 32 bits. Since the Options field may vary, variable Padding is needed.</li>
<p></p>
<li><strong>18. Data -</strong> The actual data being sent to the recipient computer.</li>
<hr /></ul>
<h3>The Anatomy of a UDP Datagram</h3>
<p class="white">Don’t worry- UDP is a lot simpler as compared to the TCP counterpart. This is due to the lack of error checking UDP contains. Although UDP is famously known for not having error checking, there are slight UDP functionalities that can act as basic error checking procedures.</p>
<p class="white">It’s important to know that the UDP error checking functionalities are quite basic. For instance, the UDP protocol contains functionality for a checksum so that we may check the integrity of data. This field can be turned off, however, so that a faster connection can be had. Also important to note is that UDP uses a fake header (known as a pseudo-header) that contains a destination address, so that we can determine whether or not the packets were sent to the right place. If they are indeed sent to the wrong place, a simple ICMP message may notify the source machine that the source is unreachable.</p>
<p class="white">Keep in mind that even if errors are found within a UDP connection, data will not be retransmitted. So how much different is a UDP datagram from a TCP segment?</p>
<p style="text-align: center"><img src="http://www.learn-networking.com/wp-content/oldimages/udp-datagram.jpg" alt="transport segment" /></p>
<p><strong>UDP Datagrams Explained</strong></p>
<ul>
<hr />
<li> <strong>1. Source Port -</strong> An optional 16-bit field that specifies which port the datagram originated from.</li>
<p></p>
<li><strong>2. Destination Port -</strong> A 16-bit field that specifies which port the datagram should be directed to on the receiving computer.</li>
<p></p>
<li><strong>3. Length -</strong> A 16-bit field that specifies how long the UDP datagram is. This includes the UDP header and the data being sent. (The value is always at least 8, since the UDP header is eight octets.)</li>
<p></p>
<li><strong>4. Checksum -</strong> A 16-bit field that operates much like the TCP counterpart. It is considered optional, however.</li>
<p></p>
<li><strong>5. Data -</strong> The actual data being sent to the recipient computer.</li>
<hr /></ul>
<p>You will notice that the datagram anatomy is much simpler- and that no source or destination information is included. So how does the data know where to go? As we briefly reviewed earlier, UDP uses what is known as a pseudo-header. This header will act as a guide for the datagram, and can determine whether the datagram was delivered to the right address or not.</p>
<h3>Closing Comments</h3>
<p>Three layers down, one more to go! In the next section we will take a look at the final TCP/IP layer: the Application Layer. We’ll take an in-depth look at just how data goes from datagrams and segments to actual information you can interact with on your computer.</p>
<img src="http://learn-networking.com/learn-networking.com/?ak_action=api_record_view&id=53&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://learn-networking.com/featured/how-the-transport-layer-works/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

