Networking: TCP/IP
TCP/IP model layers, connection-oriented VS connectionless protocols, IPv4 VS IPv6. Links: memcode.com/courses/tcp
71 flashcards · Computer Science · by lakesare
Name 3 network topologies.
bus: all nodes are attached to a single long cable. star: there is a central computer (hub) to which all the workstations are directly connected. Any computer can communicate via hub. ring: messages from one node to another travel around the loop until they reach the destination node. Links: network-topology-types
They differentiate between physical and logical configuration.
The same physical network (laptops connected by wires) can be subdivided into many logical networks.
How are bits and bytes usually signified?
b - bit B - byte Eg 500MB - is 500 Mega Byte.
Why were there these sounds in the old days when we were connecting to the internet?
The purpose of the modem is to translate your laptop's speech into something internet will understand. It was turning data into the audio signal for telephone wires.
DSL (digital subscriber line) will never get faster than 12Mb per second.
It's a physical limitation of telephone lines.
How did the internet come to be?
When it became necessary to connect multiple LANs together in one organisation. In the late 1960s, army officials noticed that military was accumulating a large collection of computers. Some of those computers weren’t networked, and others were grouped in small, closed networks with incompatible proprietary protocols. Then a group of scientists created a TCP/IP protocol that would support a wide range of hardware and provide a resilient, redundant, and decentralized system for delivering data o…
How does computer get a MAC address (media access control)?
Each computer's network adapter is assigned a number in a factory. It also gets called 'physical address'.
On a LAN, lowlying hardware-conscious protocols deliver data across the physical network using the adapter’s physical address.
On a basic ethernet network, a computer sends messages directly onto the transmission medium. The network adapter of each computer listens to every transmission on the local network to determine whether a message is addressed to its own physical address.
What are logical address and physical address also called?
logical address: IP physical address: MAC
Why is TCP/IP subdivided into layers?
The upper layers are not affected by the different physical architecture; only the Network Access layer must change. Vendor such as Microsoft does not have to build a completely different software package for TCP/IP on an optical-fiber network (as opposed to TCP/IP on an ordinary ethernet network).
VPN allows outside computers to connect into your private networks.
Name 4 layers in TCP/IP protocol suite.
Application layer - FTP, HTTP Transport layer - ensures that data is transferred without errors and in correct order; windowing Internet layer - ensures that computer can be identified by an IP address, and that data packets can travel independently to a different network Network access layer - provides an interface with the physical network
What is a default gateway?
What connects my LAN subnetwork to all the other networks (internet).
Name 2 competing protocols in Transport layer.
TCP (transmission control protocol) - both computers establish a connection, and monitor it ensuring that any faulty data is retransmitted. UDP (user datagram protocol) - destination computer doesn't return any acknowledgements, it's unreliable and fast.
What is distributed computing?
Usually we use a single computer to calculate something. When calculation is large, it may make sense to subdivide it into smaller parts, and use many computers to calculate it.
What calculations are a good choice for distributed computing?
Easily parallelizable ones - where little effort is needed to separate the problem into a number of parallel tasks.
Name 3 architectures in distributed computing.
client-server - browser takes some processing away from the server peer-to-peer - architectures where there are no special machines that provide a service or manage the network resources. Instead all responsibilities are uniformly divided among all machines, known as peers. Peers can serve both as clients and as servers. 3-tier - is a client-server variation, where application is subdivided into: presentation (React.js), business logic (Rails), data tier (PostgreSQL)
Connection-oriented VS connectionless protocols? E.g. IP, TCP, UDP?
In connection-oriented protocols hosts: establish a connection before transmitting data, send acknowledgements Connectionless protocols are usually described as stateless protocols because the end points have no protocol-defined way to remember where they are in a "conversation" of message exchanges. IP - connectionless, TCP - connection-oriented, UDP - connectionless
What is payload encapsulation in layers?
As an outgoing transmission passes down through the stack, each layer includes a header along with the payload. The Internet layer on the receiving machine uses the information in the Internet layer header.
How are PDUs (Protocol Data Unit) called in: Application layer Transport layer Internet layer Network access layer
Application layer Transport layer - segment (or datagram for UDP) Internet layer - packet (or datagram) Network access layer - frame
How TCP/IP would have to change to use a newly invented type of network?
Only a new Network Access layer would have to be written. The rest of the stack would remain the same
Even a wireless hub that connects laptops, smartphones, and other wireless devices to your home network is tethered to the wired network using ethernet cabling.
What are the most famous versions of IP (Internet Protocol)? What's the difference between them?
IPv4 - IP address takes up 4 bytes, represented as 255.255.255.255 (4 dot-separated numbers in base 10, from 0 to 255) IPv6 - IP address takes up 16 bytes, represented as 2001:0000:3238:DFE1:0063:0000:0000:FEFB (8 :-separated numbers in base 16)
How many addresses can IPv4 support?
IPv4 uses 32-bit addresses which limits the address space to 4294967296 (232) addresses. 255.255.255.255 consists of 4 bytes, or 32 bits. So we need to count possible permutations of: 00000000.11111111.10101010.00000000.
How are IP addresses assigned?
ICANN assigns a block of IP addresses to ISPs, ISP assigns one client one IP address. Multiple laptops connected to the same router will have the same IP. Links: stackoverflow answer
What endianness is used in IPv4, IPv6, TCP, and UDP?
Big-endian. Big-endian representation is the most common convention in data networking; fields in the protocols of the Internet protocol suite, such as IPv4, IPv6, TCP, and UDP, are transmitted in big-endian order. For this reason, big-endian byte order is also referred to as network byte order.
Name 4 parts of an IP packet header.
Internet Protocol Version 4: Total Length: 163 Identification: 0xdcc5 (56517) Flags: 0x00 Fragment offset: 0 Time to live: 59 - how many times IP packet can hop Protocol: UDP (17) - protocol contained in the data section Source IP: 192.168.0.1 Destination IP: 192.168.0.115
What's ARP?
ARP (Address Resolution Protocol) - a network access layer protocol for mapping a logical address (e.g. IPv4) to the physical address (MAC).
Name 2 parts of a MAC address?
First three octets: identify the organization that issued the identifier [organizationally unique identifier (OUI)]. The remainder of the address (three octets for MAC-48 and EUI-48 or five for EUI-64): are assigned by that organization in nearly any manner they please, subject to the constraint of uniqueness.
What's DHCP?
Dynamic Host Configuration Protocol - application-level protocol over UDP for assigning each computer with a private (local) IP address. Routers usually have a DHCP server built in. Every computer on a network runs a DHCP client.
What's the difference between LAN and Ethernet?
LAN - network that interconnects computers within small area (e.g. university campus). Ethernet - one of the technologies used to implement LAN. Ethernet and Wi-Fi are the two most common technologies in use for local area networks.
Name 2 technologies used to implement LANs and WANs.
LAN: Ethernet, Wi-Fi WAN: DSL, 4g, Fiber
What is promiscuous mode in wireshark?
Allows you to see packets intended for other MAC addresses in your network other than your own. In promiscuous mode the MAC address filter mentioned above is disabled and all packets of the currently joined 802.11 network (with a specific SSID and channel) are captured, just as in traditional Ethernet. However, on a "protected" network, packets from or to other hosts will not be able to be decrypted by the adapter, and will not be captured, so that promiscuous mode works the same as non-promisc…
If someone is connected to your Wi-Fi - what can they know about your network activity?
If you browse over: https: base urls you visit (google.com, but not google.com/hi) http: everything - entire urls, http requests/responses Links: stackoverflow answer
What TCP/IP layer does DNS reside on? What underlying protocols does DNS use?
DNS is an application-level protocol (along with HTTP). Sometimes UDP, sometimes TCP (or switches between them, e.g. uses TCP when packet size is larger)! It frequently uses UDP for speed. Links: SO on why DNS uses UDP
What TCP/IP layer does ARP reside on?
Network layer.
Name 4 parts of an ARP header.
Address Resolution Protocol (request) Hardware type: Ethernet (1) Protocol type: IPv4 (0x0800) Hardware size: 6 Protocol size: 4 Opcode: request (1) Sender MAC address: Tp-LinkT_22:01:02 (18:d6:c7:22:01:02) Sender IP address: 192.168.0.100 Target MAC address: 00:00:00_00:00:00 (00:00:00:00:00:00) Target IP address: 192.168.0.60 Here router is sending a request asking who has an 192.168.0.60 IP address.
What's TTL in an IP packet header?
Time To Live: helps to prevent IP packets from going in loops between routers. TTL is specified in seconds, but in practice it became a hop count. An eight-bit time to live field helps prevent datagrams from persisting (e.g. going in circles) on an internet. This field limits a datagram's lifetime. It is specified in seconds, but time intervals less than 1 second are rounded up to 1. In practice, the field has become a hop count—when the datagram arrives at a router, the router decrements the T…
Many protocol headers contain a protocol field. What's inside of it? E.g. IP packet:
Defines the protocol used in the data portion. IANA maintains a list of IP protocol numbers which was originally defined in RFC 790. Links: wikipedia on IP packet header.protocol
What's meant by a stream index in Wireshark?
The stream index is an internal Wireshark mapping to: [ IP address A, port A, IP address B, port B ] All the packets for the same tcp.stream value should have the same values for these fields. It is counted by conversation, which is based on TCP socket pairs. So each socket pair (consisting of IP_1:Port_1 - IP_2:Port_2) is a conversation. The first conversation has stream index 0, the second has stream index 1, and so on.
What ports does HTTP and HTTPS use?
HTTP: port 80 HTTPS: port 443
What is port scanning?
The practice of attempting to connect to a range of ports in sequence on a single computer. This is usually associated either with malicious crackingattempts or with network administrators looking for possible vulnerabilities to help prevent such attacks. Port connection attempts are frequently monitored and logged by computers. The technique of port knocking uses a series of port connections (knocks) from a client computer to enable a server connection.
What's a protocol data unit (PDU) for TCP and UDP?
For TCP: segment for UDP: datagram
Why do you need sudo to connect to ports < 1024?
Because these are often deemed critical to the operation of IP networks. Conversely, the client end of a connection typically uses a high port number allocated for short term use, therefore called an ephemeral port.
What's the max port number in computers?
65535, because port number is a 16-bit unsigned integer, and ports start from 0.
Who defines port numbers (e.g. 80 for HTTP)?
The well-known ports are defined by convention overseen by the Internet Assigned Numbers Authority (IANA).
What's a port VS network socket?
Once server has some 'socket bound to ip:port', it will accept connections - each time a new client connects, a new socket is created specific to that client.
What's web socket?
There is no such thing as 'web socket', there is 'WebSocket'! Application-level protocol (along with HTTP) on top of TCP, that allows a full-duplex communication over a single TCP connection.
Where is DHCP server usually located?
A router or a residential gateway can be enabled to act as a DHCP server.
Public vs local IP address?
Your Internet Service Provider (ISP) assigns you an external IP address when you connect to the Internet The local IP address can change depending on what other devices are connected to the same network and in what order they were connected. Most network routers assign IP addresses starting at 192.168.1.2, and increment the last digit with each new device that connects.
What protocol assigns local IP addresses?
Most residential network routers receive a globally unique IP address within the ISP network. Within a local network, a DHCP server assigns a local IP address to each device connected to the network.
Suppose you google for a 'my public and local IP address?' on your phone and laptop. What will the results be?
Your public IP addresses should be the same, and local IP addresses should be different. Laptop: Your Local IP is: 192.168.0.115 Your Public IPv4 Address Is: 81.30.211.38 Phone: Your Local IP is: 192.168.0.113 Your Public IPv4 Address Is: 81.30.211.38 Links: determine your ip
Name 4 routing delivery schemes (...casts).
unicast: delivers a message to a single specific node broadcast: delivers a message to all nodes in the network multicast: delivers a message to a group of nodes that have expressed interest in receiving the message anycast: delivers a message to any one out of a group of nodes, typically the one nearest to the source Links: wikipedia - routing
What's meant by the flow control in networking?
Managing the rate of data transmission between two nodes to prevent a fast sender from overwhelming a slow receiver.
DHCP vs ARP?
DHCP maps local IPs to global IPs. ARP maps MAC addresses to local IPs.
What does NAT stand for?
Network address translation The simplest type of NAT provides a one-to-one translation of IP addresses.
What's an Ethernet Address?
Same as the MAC (Media Access Control) address.
Is it possible to change one's MAC address?
Yes, many network interfaces support changing their MAC address. According to Edward Snowden, the US National Security Agency has a system that tracks the movements of everyone in a city by monitoring the MAC addresses of their electronic devices. As a result of users being trackable by their devices' MAC addresses, Apple has started using random MAC addresses in their iOS line of devices while scanning for networks.
What is encapsulation in TCP/IP?
Application layer wants to pass some data, so it creates a PDU (protocol data unit): data + layer7header, etc. (Data Link layer also adds a L2Trailer, and Physical layer adds nothing, it just passes information through the wire) When the second computer receives physical data, it starts stripping off headers from down up.
What does OSI model stand for?
Open Systems Interconnection.
Name OSI model layers.
How do OSI layers relate to TCP/IP layers?
What does ICMP stand for?
Internet Control Message Protocol.
What's ICMP?
Internet Control Message Protocol. used by routers to send error messages and operational information indicating, for example, that a requested service is not available or that a host or router could not be reached.
Why is it advised to use SSH instead of Telnet for remote logins into terminals?
Mostly security, Telnet doesn't encrypt the connection. SSH was designed as a replacement for Telnet and for unsecured remote shell protocols Links: en.wikipedia.org/wiki/Telnet#Security
Does network topology refer to the physical or logical arrangement?
It can refer to any. Network topology is the topological structure of a network and may be depicted physically or logically.
What's Exponential backoff?
When 2 hosts multiplicatively decrease the rate of transmission in order to avoid congestion. This example is from the Ethernet protocol, where a sending host is able to know when a collision has occurred (that is, another host has tried to transmit), when it is sending a frame. If both hosts attempted to re-transmit as soon as a collision occurred, there would be yet another collision — and the pattern would continue forever. When a collision first occurs, send a "Jamming signal" to prevent fu…
What do these stand for: SSL TLS
SSL - Secure Sockets Layer TLS - Transport Layer Security
SSL vs TLS?
SSL - deprecated TLS - new version of SSL
How does SSL/TLS relate to HTTP and other protocols?
TLS is usually implemented on top of TCP, encrypting all of the data of protocols such as HTTP, FTP, SMTP, etc. Historically, TLS has been used primarily with reliable transport protocols such as the Transmission Control Protocol (TCP). However, it has also been implemented with datagram-oriented transport protocols, such as the User Datagram Protocol (UDP) and the Datagram Congestion Control Protocol (DCCP), usage of which has been standardized independently using the term Datagram Transport L…
Name 3 differences between HTTP 1.0 and HTTP 2.0.
HTTP 1.0: text protocol. HTTP 2.0: binary protocol. HTTP 1.0: can't stop sending once HTTP message has been sent off with a Content-Length of a certain size, HTTP 2.0: can stop sending with RST_STREAM frame. HTTP 1.0: currently browsers can open up to 6 parallel connections per domain. HTTP 2.0: allows multiplexing! Enables data reading from up to 256 resources. http2 is binary to make the framing much easier. Figuring out the start and the end of frames is one of the really complicated things…