Blame
Date:
Mon Jan 23 05:00:25 2023 UTC
Message:
Daily backup
01
2023-01-22
jrmu
version=pmwiki-2.2.130 ordered=1 urlencoded=1
02
2023-01-22
jrmu
agent=Mozilla/5.0 (X11; OpenBSD amd64; rv:82.0) Gecko/20100101 Firefox/82.0
03
2023-01-22
jrmu
author=jrmu
04
2023-01-22
jrmu
charset=UTF-8
05
2023-01-22
jrmu
csum=
06
2023-01-22
jrmu
ctime=1613300552
07
2023-01-22
jrmu
host=198.251.81.119
08
2023-01-22
jrmu
name=Tcpip.Overview
09
2023-01-22
jrmu
rev=1
10
2023-01-22
jrmu
targets=
11
2023-01-22
jrmu
text=(:title TCP/IP Overview:)%0a%0aEvery computer on the internet uses the Internet Protocol (IP). There are two protocols that are added on top of IP: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).%0a%0a'''TCP''' is used when we need to send data in a '''reliable''' way. For example, email uses TCP because every word in a letter is important. '''UDP''' is used when some data loss is acceptable and '''speed''' is the most important. For example, audio phone calls use UDP because losing a few datagrams hurts sound quality only slightly. You can learn more about common applications, their protocols, and their ports by viewing /etc/services.%0a%0aIP is used to carry packets of information. Inside those packets, we have different data that follows different protocols depending upon the application. Common applications include SMTP for email, FTP for uploading/downloading files, SSH for remotely connecting to computers, HTTP for the world wide web, IRC for text messages and chat, and so on.%0a%0aTCP/IP relies on client-server architecture. One side will act as the '''server''', and another side the '''client'''. The client requests information, and the server delivers it. For example, if you use your phone to view a video, your phone is the client, and the server is in a data center. The server is often an expensive machine with a fast internet connection, but not always. Any computer running the right software can act as a server. For example, your home desktop PC could run an IRC server and serve chat messages which your phone could request. In fact, even your phone can run a web server and deliver web pages to other desktop PCs, which would become clients. There is no physical definition of a server; the only definition is that the client requests information and the server responds to it. %0a%0a!! IP Addresses%0a%0aEach computer has at least one network interface to connect it with the global Internet. Each network interface will have at least one IP address, which will look something like 192.168.0.1. Each IP address can have any number of ports starting from 1 to 65535. When you combine an IP address with a port, you have a '''socket'''. For example, 192.168.0.1:443 is the socket that your web server (openhttpd) listens on.%0a%0aEvery client must specify a unique socket with a specific protocol, and the server must listen on that exact same combination in order to respond. For example, suppose you send a request to a web server with IP 192.168.0.1 on port 443 using TCP. If the web server is instead listening on a different socket (IP 192.168.0.1 port 80 using TCP), the web server will '''not''' to respond. Port 443 is not the same as port 80. Both the socket and protocol must be identical. If the IP address, port, or protocol type is wrong, the client-server connection will not work.%0a%0aIP addresses are not physically bound to any hardware device. A hardware device can easily change its IP address. As a result, when routing packets, it becomes necessary to know which networking interface an IP address is actually referring to. This is where ethernet MAC addresses often come in. MAC addresses are a unique 48-bit identifier which uniquely identify network interfaces on hardware. They are usually written in hexadecimal (such as 01:23:45:67:89:ab).%0a%0aServers sometimes ask you to '''bind''' to an IP address. This means that the server will listen and send packets using only that IP address. This can be important if your server has multiple IP addresses it can choose from; you may only want to use one for your server.%0a%0a!! Subnets%0a%0aIPv4 addresses are written as four numbers separated by periods (dotted-quad notation). They are, however, stored on the computer using binary. For example, 192.168.0.1 in binary could be represented as 11000000.10101000.00000000.00000001. Each IPv4 address can be separated into a '''subnet identifier''' and a '''host identifier'''.%0a%0aThe Internet has billions of computers on it, so it is helpful to be able to divide all these computers into smaller subnetworks, or '''subnets''' for short. Once we group up all the computers into subnets, it will make it much easier to find a subnet, and then to find a computer inside the subnet. Routers use this in order to help with routing (delivering) packets to the right place.%0a%0aSuppose the first 24 bits of the IPv4 address are part of the subnet identifier. We would indicate this by adding /24 at the end of the IPv4 address: 192.168.0.1/24. This tells us that the first 24 bits of the IPv4 address indicate what subnet the address is a part of; and that the last 8 bits indicate the device on the subnet.%0a%0aComputers often use bitmasks in order to quickly calculate the subnet identifier and the host identifier. The '''subnet mask''' is basically a number where all the binary digits of the subnet are 1s, and the rest are 0s. So a /24 subnet mask could be described in three ways. In binary, it would be 11111111.11111111.11111111.00000000. In dotted-quad notation, it is 255.255.255.0. In hexadecimal, it is 0xffffff00. You will find this information very valuable later when you configure your network interface's subnet mask and default gateway.%0a%0a!! Special Addresses%0a%0aSome IPv4 addresses have special meaning. IP addresses from 127.0.0.0 to 127.255.255.255 are loopback addresses. This address refers to your current computer itself. Instead of using the network to connect to another computer, you use the network to connect to yourself. Using a loopback address helps you test a network service without having to use the Internet. For example, you might install a web server and then view it locally by visiting http://127.0.0.1.%0a%0aNotice that we can rewrite this address range more compactly by using 127.0.0.0/8. Here, we are referring to the entire subnet where the first 8 bits are the same as in the IPv4 address 127.0.0.0.%0a%0aThere are a few other reserved IP addresses you should also be aware of. For example, 192.0.0.0/24 refers to a private network that is not connected to the Internet. For this reason, an IP address like 192.168.0.1 can '''never''' be used for a public Internet service.
12
2023-01-22
jrmu
time=1613300552
13
2023-01-22
jrmu
title=TCP/IP Overview
14
2023-01-22
jrmu
author:1613300552=jrmu
15
2023-01-22
jrmu
diff:1613300552:1613300552:=1,37d0%0a%3c (:title TCP/IP Overview:)%0a%3c %0a%3c Every computer on the internet uses the Internet Protocol (IP). There are two protocols that are added on top of IP: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).%0a%3c %0a%3c '''TCP''' is used when we need to send data in a '''reliable''' way. For example, email uses TCP because every word in a letter is important. '''UDP''' is used when some data loss is acceptable and '''speed''' is the most important. For example, audio phone calls use UDP because losing a few datagrams hurts sound quality only slightly. You can learn more about common applications, their protocols, and their ports by viewing /etc/services.%0a%3c %0a%3c IP is used to carry packets of information. Inside those packets, we have different data that follows different protocols depending upon the application. Common applications include SMTP for email, FTP for uploading/downloading files, SSH for remotely connecting to computers, HTTP for the world wide web, IRC for text messages and chat, and so on.%0a%3c %0a%3c TCP/IP relies on client-server architecture. One side will act as the '''server''', and another side the '''client'''. The client requests information, and the server delivers it. For example, if you use your phone to view a video, your phone is the client, and the server is in a data center. The server is often an expensive machine with a fast internet connection, but not always. Any computer running the right software can act as a server. For example, your home desktop PC could run an IRC server and serve chat messages which your phone could request. In fact, even your phone can run a web server and deliver web pages to other desktop PCs, which would become clients. There is no physical definition of a server; the only definition is that the client requests information and the server responds to it. %0a%3c %0a%3c !! IP Addresses%0a%3c %0a%3c Each computer has at least one network interface to connect it with the global Internet. Each network interface will have at least one IP address, which will look something like 192.168.0.1. Each IP address can have any number of ports starting from 1 to 65535. When you combine an IP address with a port, you have a '''socket'''. For example, 192.168.0.1:443 is the socket that your web server (openhttpd) listens on.%0a%3c %0a%3c Every client must specify a unique socket with a specific protocol, and the server must listen on that exact same combination in order to respond. For example, suppose you send a request to a web server with IP 192.168.0.1 on port 443 using TCP. If the web server is instead listening on a different socket (IP 192.168.0.1 port 80 using TCP), the web server will '''not''' to respond. Port 443 is not the same as port 80. Both the socket and protocol must be identical. If the IP address, port, or protocol type is wrong, the client-server connection will not work.%0a%3c %0a%3c IP addresses are not physically bound to any hardware device. A hardware device can easily change its IP address. As a result, when routing packets, it becomes necessary to know which networking interface an IP address is actually referring to. This is where ethernet MAC addresses often come in. MAC addresses are a unique 48-bit identifier which uniquely identify network interfaces on hardware. They are usually written in hexadecimal (such as 01:23:45:67:89:ab).%0a%3c %0a%3c Servers sometimes ask you to '''bind''' to an IP address. This means that the server will listen and send packets using only that IP address. This can be important if your server has multiple IP addresses it can choose from; you may only want to use one for your server.%0a%3c %0a%3c !! Subnets%0a%3c %0a%3c IPv4 addresses are written as four numbers separated by periods (dotted-quad notation). They are, however, stored on the computer using binary. For example, 192.168.0.1 in binary could be represented as 11000000.10101000.00000000.00000001. Each IPv4 address can be separated into a '''subnet identifier''' and a '''host identifier'''.%0a%3c %0a%3c The Internet has billions of computers on it, so it is helpful to be able to divide all these computers into smaller subnetworks, or '''subnets''' for short. Once we group up all the computers into subnets, it will make it much easier to find a subnet, and then to find a computer inside the subnet. Routers use this in order to help with routing (delivering) packets to the right place.%0a%3c %0a%3c Suppose the first 24 bits of the IPv4 address are part of the subnet identifier. We would indicate this by adding /24 at the end of the IPv4 address: 192.168.0.1/24. This tells us that the first 24 bits of the IPv4 address indicate what subnet the address is a part of; and that the last 8 bits indicate the device on the subnet.%0a%3c %0a%3c Computers often use bitmasks in order to quickly calculate the subnet identifier and the host identifier. The '''subnet mask''' is basically a number where all the binary digits of the subnet are 1s, and the rest are 0s. So a /24 subnet mask could be described in three ways. In binary, it would be 11111111.11111111.11111111.00000000. In dotted-quad notation, it is 255.255.255.0. In hexadecimal, it is 0xffffff00. You will find this information very valuable later when you configure your network interface's subnet mask and default gateway.%0a%3c %0a%3c !! Special Addresses%0a%3c %0a%3c Some IPv4 addresses have special meaning. IP addresses from 127.0.0.0 to 127.255.255.255 are loopback addresses. This address refers to your current computer itself. Instead of using the network to connect to another computer, you use the network to connect to yourself. Using a loopback address helps you test a network service without having to use the Internet. For example, you might install a web server and then view it locally by visiting http://127.0.0.1.%0a%3c %0a%3c Notice that we can rewrite this address range more compactly by using 127.0.0.0/8. Here, we are referring to the entire subnet where the first 8 bits are the same as in the IPv4 address 127.0.0.0.%0a%3c %0a%3c There are a few other reserved IP addresses you should also be aware of. For example, 192.0.0.0/24 refers to a private network that is not connected to the Internet. For this reason, an IP address like 192.168.0.1 can '''never''' be used for a public Internet service.%0a\ No newline at end of file%0a
16
2023-01-22
jrmu
host:1613300552=198.251.81.119
IRCNow