Ch. 6 TCP/IP Basics Flashcards
The _______ _______ (IP) works at the Internet layer, taking data chunks from the Transport layer, adding addressing, and creating the final IP packet. IP then hands the IP packet to Layer 2 for encapsulation into a frame. Let’s look at the addressing in more depth.
Internet Protocol
All _____ block private IP addresses. Those addresses can never be used on the Internet, making them a handy way to hide systems. Anyone can use these private IP addresses, but they’re useless for systems that need to access the Internet—unless you use the mysterious and powerful NAT
routers
The full IP packet header has __ different fields. As you would expect, the destination and source IP addresses are part of the Internet layer.
14
The ______ (Ver) field defines the IP address type: 4 for IPv4, 6 for IPv6
version
Remember:
The full IP packet header has 14 different fields.
Ver 32 bits DSCP TTL TCP
The total size of the IP portion of the packet in words (32 bits) is displayed in the _______ length field.
header
Remember:
The full IP packet header has 14 different fields.
Ver 32 bits DSCP TTL TCP
The ____ field contains data used by bandwidth-sensitive applications like Voice over IP. (Network techs with long memories will note that this field used to be called the type of service field.)
DSCP - Differentiated services code point
Remember:
The full IP packet header has 14 different fields.
Ver 32 bits DSCP TTL TCP
Implementations of routers on the Internet are not perfect and engineers sometimes create loops. The ____________ (TTL) field prevents an IP packet from indefinitely spinning through the Internet by using a counter that decrements by one every time a packet goes through a router. This number cannot start higher than 255; many applications start at 128.
Time to live (TTL)
Remember:
The full IP packet header has 14 different fields.
Ver 32 bits DSCP TTL TCP
In the vast majority of cases, the _______ field is either TCP or UDP and identifies what’s encapsulated inside the packet. See the next section for more information.
protocol
Time to live (TTL)
Remember:
The full IP packet header has 14 different fields.
Ver 32 bits DSCP TTL TCP
Let me be clear: you don’t choose ___ or ___. The people who developed the applications decide which protocol to use. When you fire up your Web browser, for example, you’re using TCP because Web browsers use a protocol called Hypertext Transfer Protocol (HTTP) and the developers of HTTP decided to build HTTP using TCP.
TCP; UDP
Most TCP/IP applications use TCP—that’s why we call the protocol suite “TCP/IP” and not “UDP/IP.” TCP gets an application’s data from one machine to another reliably and completely. As a result, TCP comes with communication rules that require both the sending and receiving machines to acknowledge the other’s presence and readiness to send and receive data. We call this process the TCP _____-___ _______ of SYN, SYN-ACK, and ACK. TCP also chops up data into segments, gives the segments a sequence number, and then verifies that all sent segments were received. If a segment goes missing, the receiving system must request the missing segments.
three-way handshake
Picture (in answer) shows a simplified TCP header. Notice the source port and the destination port. ____ numbers are values ranging from 1 to 65,535 and are used by systems to determine what application needs the received data. Each application is assigned a specific port number on which to listen/send. Web servers use port 80 (HTTP) or 443 (HTTPS), for example, whereas port 143 is used to receive e-mail messages from e-mail servers (IMAP4).
Port
Picture of TCP Header:
Source port Destination Port Sequence Number ACK
NOTE:
The client uses the source port number to remember which client application requested the data. The rest of this book dives much deeper into ports. For now, know that the TCP or UDP headers of an IP packet store these values. Also, Data gets chopped up into chunks at the Transport layer when using TCP. The chunks are called segments with TCP. UDP datagrams don’t get chopped up at the Transport layer; they just get a header.
Ports aren’t the only items of interest in the TCP header. The header also contains these fields:
- Sequence and ACK numbers These numbers enable the sending and receiving computers to keep track of the various pieces of data flowing back and forth.
- Flags These individual bits give both sides detailed information about the state of the connection.
- Checksum The checksum checks the TCP header for errors.
___ is the “fire and forget” missile of the TCP/IP protocol suite. As you can see in (Picture) a UDP datagram doesn’t possess any of the extras you see in TCP to make sure the data is received intact. UDP works best when you have a lot of data that doesn’t need to be perfect or when the systems are so close to each other that the chances of a problem occurring are too small to bother worrying about. A few dropped frames on a Voice over IP call, for example, won’t make much difference in the communication between two people. So, there’s a good reason to use UDP: it’s smoking fast compared to TCP. Two of the most important networking protocols, Domain Name System (DNS) and Dynamic Host Configuration Protocol (DHCP), use UDP.
UDP
Picture of UDP Header:
Source port Destination Port Length Checksum
NOTE:
Data gets chopped up into chunks at the Transport layer when using TCP. The chunks are called segments with TCP. UDP datagrams don’t get chopped up at the Transport layer; they just get a header.
At the LAN level, every host runs TCP/IP software over Ethernet hardware, creating a situation where every host has two addresses: an __ address and an Ethernet ___ address. While at first this seems redundant, it’s the power behind TCP/IP’s ability to support both LANs and WANs.
IP; MAC
Note that the __ packet is completely encapsulated inside the Ethernet frame. Also note that the Ethernet frame has both a destination MAC address and a source MAC address, while the IP packet encapsulated in the Ethernet frame has both a source IP address and a destination IP address. This encapsulation idea works great, but there’s a problem: Computer A knows Computer B’s IP address, but how does Computer A know the MAC address of Computer B?
IP
Answer:
To get Computer B’s MAC address, Computer A sends a very special command called an Address Resolution Protocol (ARP) request to MAC address FF-FF-FF-FF-FF-FF, the universal MAC address for broadcast.
Computer A says, “who has IP address 192.168.5.45? Please tell 192.168.5.23 (A)”
Computer B responds to the ARP request by sending Computer A an ARP reply, “192.168.5.23, I’m 192.168.5.45! My MAC address is 00:40:05:60:7D:49.”
Computer A has Computer B’s MAC address, it starts sending unicast Ethernet frames directly to Computer B.
Encapsulation:
Destination MAC Source MAC Type Dest. IP Source IP
Data FCS
NOTE: From Destination MAC to FCS is the Ethernet Frame. And from Destination IP to Data is the IP Packet
IPv4’s dotted decimal notation (also referred to as the dotted _____ _________ system).
octet numbering
NOTE:
That dotted decimal is simply a shorthand way for people to discuss and configure the binary IP addresses computers use.
In a small TCP/IP network, every computer has both an IP address and a ____ address
MAC
A WAN is nothing more than a group of two or more interconnected LANs. For a WAN to work, each LAN needs some form of unique identifier called a ______ __.
network ID
To differentiate LANs from one another, each computer on a single LAN must share a very _____, but not identical, IP address. Some parts of the IP address will match all the others on the LAN. (Picture) shows a LAN where all the computers share the first three numbers of the IP address, with only the last number being unique on each system.
similar
Picture:
Computer A: 202.120.10.42
Computer B: 202.120.10.83
Computer C: 202.120.10.64
Computer D: 202.120.10.78
NOTE:
In this example, every computer has an IP address of 202.120.10.x, where the x value is unique for every host, but every host’s IP address starts with 202.120.10. That means the network ID is 202.120.10.0. The x part of the IP address is the host ID. Combine the network ID (after dropping the ending 0) with the host ID to get an individual system’s IP address. No individual computer can have an IP address that ends with 0 because that is reserved for network IDs.
NOTE:
Two things to note here. First, the network ID and the host ID are combined to make a system’s IP address. Second, a host ID can end in 0—although this is uncommon.
To organize all those individual LANs into a larger network, every TCP/IP LAN that wants to connect to another TCP/IP LAN must have a _____ connection. There is no exception to this critical rule. A router, therefore, needs an IP address on every LAN that it interconnects, so it can correctly send (route) the packets to the correct LAN.
router
The router interface that connects a single LAN to the router is known as the _______ gateway. In a typical scenario configuring a client to access the network beyond the router, you use the IP address of the ______ gateway. The ________ gateway is in the same network ID as the host. The person who sets up the router must make sure that they configure the router’s LAN interface to have an address in the LAN’s network ID. By convention, most network administrators give the LAN-side NIC on the default gateway the lowest host address in the network, usually the host ID of 1. Therefore, if a network ID is 22.33.4.x, the router is configured to use the address 22.33.4.1.
default; default; default
Routers use network IDs to determine network traffic. (Picture 6-24) shows a diagram for a small, two-NIC router similar to the ones you see in many homes. Note that one port (202.120.10.1) connects to the LAN and the other port connects to the Internet service provider’s network (14.23.54.223). Built into this router is a ______ table, the actual instructions that tell the router what to do with incoming packets and where to send them.
routing
Picture:
To LAN:
202.120.10.1 –> Router –> Everything Else –> To ISP
Everything for goes out
202.120.10.0 14.23.54.223
goes out of
202.120.10.1
https://learning.oreilly.com/library/view/comptia-network-certification/9781260122398/fig06-24.jpg
With a network ID of 202.120.10.0, for example, a network is limited to IP addresses from 202.120.10.1 to 202.120.10.254. (202.120.10.255 is a broadcast address used to talk to every computer on the LAN.) This provides only ___ IP addresses: enough for a small network, but many organizations need many more IP addresses. No worries! You can simply use a network ID with more zeroes, such as 170.45.0.0 (for a total of 65,534 hosts) or even 12.0.0.0 (for around 16.7 million hosts).
254
NOTE:
Network IDs are very flexible, as long as no two interconnected networks share the same network ID. If you wished, you could change the network ID of the 202.120.10.0 network to 202.155.5.0, or 202.21.8.0, just as long as you can guarantee no other LAN on the WAN shares the same network ID.
A subnet mask is nothing more than a string of ones followed by some number of zeroes, always totaling exactly __ bits, typed into every TCP/IP host. Here’s an example of a typical subnet mask:
11111111111111111111111100000000
Then convert each octet into decimal (use a calculator):
255.255.255.0
32
NOTE:
Computer A wants to send a packet to Computer B. Computer B is on the same LAN as Computer A, but that begs a question: How does Computer A know this? Every TCP/IP computer needs a tool to tell the sending computer whether the destination IP address is local or long distance. This tool is the subnet mask.