Data Transfer Over Networks

Jason Dion • 500,000+ Enrollments Worldwide
A free video tutorial from Jason Dion • 500,000+ Enrollments Worldwide
CISSP, CEH, Pentest+, CySA+, Sec+, Net+, A+, PRINCE2, ITIL
4.6 instructor rating • 25 courses • 320,066 students

Lecture description

A discussion of ports, protocols, and other important facts to review before sitting for the Network+ (or any other IT certification) exam.

Learn more from the full course

CompTIA Network+ (N10-007) Full Course & Practice Exam

CompTIA Network+ (N10-007) Bootcamp - Certification preparation course on the most popular networking certification!

14:30:22 of on-demand video • Updated April 2021

  • Passing the Network+ certification exam with confidence
  • Understanding computer networks, their functions, and their components
  • Subnetting networks
  • Performing basic network configurations
  • Becoming an effective networking technician in a small-to-medium sized business environment
English -: Data Transfer Over Networks. So, when we transfer data over our networks, we have to find a way to tell the data where it's going to go. Now, we use IP addresses to get data to the right system. But how does it know what application is listening on that particular system? Well, that's where a port comes in. I like to think about it this way, if I give you my street address, that's like my IP address. You can find my exact house within my neighborhood. But, how are you going to find my bedroom, my home office, or my living room. Each of those rooms is going to serve a different function, like sleeping, working, or relaxing. Well, this is where a port is going to come in. A Port is a logical opening in a computer that represents a service or application that's listening and waiting for traffic. So, in my house example, maybe I gave you my address as 123 Main Street, room number two. This tells you to go to the house and enter the second room, which is my home office where I might be working at. Now, in computer networks, our ports are going to be numbered from zero all the way up to 65,535. That is a lot of ports. So, even though you only have one IP on your machine, you can have over 65,000 different openings for you to be able to run different services and applications on. Now, that large number of ports is actually broken up into two distinct groups. The first is called the Well-known and Reserved Ports. These are the ports that are numbered from zero through a 1023. These include things like the File Transfer Protocol on port 21, Web Browsing on port 80, or the Simple Mail Transfer Protocol on port 25, among other things. Ephemeral Ports, on the other hand, are short-lived temporary ports. And these are open for just a small period of time from a predefined range of ports. These ports can exist from Port 1024, all the way up to 65,535. For example, as I'm recording this lesson, I record the audio on a device which acts a file server, and it's going to pick a random port somewhere around port 60,000. Now, when I want to download the audio file from the device, I'm going to use a web browser on my computer to access it and download that audio file. When I do that, what happened is that I just opened up a port on the device for as long as it's needed in order to download that file and then the port is going to close up again, just that quickly. Now, data transfer occurs using these IP addresses in these ports. So, what does all this look like inside the real world? Well, as you can see here, I have a Client on the left and a Website on the right. The Client is at the address 192.168.1.24, and the Website is at 64.82.46.21. So, for the client to make a request to this website, it's going to come from the source IP, that 192 address, and a port, just some random high port that it's going to pick from the Ephemeral port range. Now, in this case, it shows port number 49,163, but it could have been any Ephemeral port. Now, we're going to take that data and we're going to send it to the destination of the website, which in this case is going to be the IP address of 64. something that you see here on the web server. This is going to act as our destination IP. And what port do you think it's going to go to? Well, it's going to use the default port for websites, which is Port 80. Now, the website, on the other hand is going to reverse this process. And it's going to go from its source IP and its own port 80 back to the client on its random high port, which was port 49,163. So, you can see how this communication happens to establish this session. And then, they can communicate back and forth between the two servers and the client over these two ports. Whenever we're done transmitting this website, that random high port that was opened on your client, it's going to get closed and another random high port will be opened the next time you need to communicate. But back on the web server, port 80 is going to sit there and always remain open ready to serve requests from anybody who wants to communicate with that website. So, when we send the information across the network, we're doing this as an IPv4 packet. Now, IP version four packets consist of a source address, that's the IP address of the sender, a destination address, the IP address of the receiver, the IP flags, which is going to allow the packet fragmentation other special things to occur, and the protocol, which is whether we're going to communicate using TCP or UDP. All of those things are going to make up this packet header and you can see it shown here on the screen. Now, many times students asked me if they have to memorize this packet header for the exam. Well, the answer is no, no, no, no, no, no. You don't have to worry about it, because no one is going to ask you to draw out or diagram a packet for the exam. That said, I do want you to understand that your header contains a couple of key pieces of information. Things like your source and destination IP, as well as the ports and the protocols and things of that nature. This tells your packet where it needs to get routed to. Now, back when we talked about TCP and UDP, we talked about the fact that TCP had a lot more overhead. But, what does that really look like inside of these packets? Well, that's what I have here on the screen. On the top, you can see the TCP header, which is 20 bytes in length. And you can see some things that it contains, like the Source Port and the Destination Port, the Sequence Number, the Acknowledgement Number, and then a bunch of other flags. All of that with the Checksum and the Pointers, it all adds this overall length, making it a pretty bulky protocol. Now, we can compare this TCP header with a UDP header that's shown here on the bottom. It only has four pieces of information. It has a Source Port, a Destination Port, the length of the packet and the Checksum. That's it, and it's only eight bytes long. So, you can see there's a lot less data there in that UDP header because there's less that needs to be contained. And so, it allows us to have a faster, more efficient protocol. Again, you don't need to memorize these headers for the exam. But you should remember that TCP is bulkier with its 20-byte header than UDP is with its 8-byte header. Because of this additional overhead in the TCP protocol, UDP is considered much faster.