Networking Review and Socket Programming

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/48

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering OSI and TCP/IP models, layer functions, addressing, network protocols, and C socket API functions.

49 Terms

1
New cards

OSI Model

Open Systems Interconnection


Seven layers that computer systems use to communicate over a network.

2
New cards

OSI Seven Layers


<p></p>
3
New cards

Delivering Messages

send locally to a device on the same subnetwork (switch)


or


send remotely (router)

4
New cards

Layer 2 Switch

A network device, operating at Layer 2(Data Link), responsible for forwarding data frames between devices within the same LAN


5
New cards

Switch facts

Layer 2 switches forward data only to the device it is intended for, using MAC addresses.


Multilayer switches can also route at Layer 3

6
New cards

Router

A networking device operating at Layer 3 (Network) connects multiple networks and receives, analyze, and forwards data packets between them using IP addresses.

7
New cards

Default Gateway

used when destination host is outside the network; it locates the destination's network and forwards the packet

8
New cards

TCP/IP Model

a layered networking framework about how data is transmitted between devices over a network using standardized protocols

9
New cards

TCP/IP Model Four Layers

Link → Internet → Transport → Application

(LITA)


(or five layers when Physical is separated from Link, PLITA)

10
New cards

Protocol Data Unit (PDU)

The specific unit of information handled by a OSI layer or protocol.

11
New cards

PDU Units of Information

Physical Layer → bits

Data Link Layer → frames

Network Layer → packets

Transport Layer → TCP segment

or

→ UDP datagram

Session Layer → data

Presentation Layer → data

Application Layer → data



12
New cards

Packet

The PDU handled at Layer 3 (Network).

13
New cards

Frame

The PDU handled at Layer 2 (Data Link)


contains a header, payload, and trailer —— used in Ethernet to carry MAC addresses and error-detection data.

14
New cards

TCP segment or UDP datagram

The PDU handled at Layer 4 (Transport)

15
New cards

Media Independence (IP packets)

IP is media independent because it operates at Layer 3 (network layer) and doesn't care about the physical medium carrying the bits



— it simply hands packets to the lower layers (Data Link and Physical) to transmit, and its header format stays the same whether the packet travels over copper, fiber, or wireless. 

16
New cards

Synchronous Communication

data communication that uses coordinated timing, such as a shared or recovered clock

17
New cards

Asynchronous Communication

data communication that operates without a continuously shared clock, instead uses start/stop bits for framing


In programming, asynchronous also describes operations that can complete later

18
New cards

MAC Address

a link-layer address identifying a network interface on a local network


Ethernet normally uses 48 bits, written as six hexadecimal byte pairs

19
New cards

FF:FF:FF:FF:FF:FF

used for the Ethernet broadcast destination:


Frames that are destined with MAC address FF-FF-FF-FF-FF-FF will reach every computer belonging to that LAN segment

20
New cards

Organizationally Unique Identifier (OUI)

The First 6 digits (say 00:40:96) of the MAC Address identify

the manufacturer, called the OUI (Organizational Unique Identifier)

21
New cards

Hop-by-Hop MAC Rewriting

each router strips the incoming frame and creates a new frame addressed to the next hop MAC


Ordinary switches generally preserve the source and destination MAC addresses.

22
New cards

IPv4 Address

A 32 bit numerical network address represented in dotted-decimal format (e.g., 192.0.2.1).

23
New cards

IPv6 Address

A 128 bit hexadecimal network address (e.g., 2001:db8::1)

it uses multicast instead of broadcast

24
New cards

Transmission Control Protocol (TCP)

A connection-oriented Layer 4 (Transport) protocol provides reliable and ordered byte-stream delivery


does retransmissions, flow control, and congestion control via segments

25
New cards

User Datagram Protocol (UDP)

A connectionless Layer 4 (Transport) protocol that sends independent datagrams without guarantees of delivery or ordering


operating with lower overhead…speed over reliability

26
New cards

Port Numbers

16 bit transport-layer numbers ranging from 00 to 65535 used to identify application endpoints or services on a host


Layer 4 (Transport): IP address + Port + Protocol

27
New cards

ACK and NACK

Control signals where ACK indicates successful data receipt and NACK (or NAK) explicitly reports missing or rejected data in protocols configured for it.

28
New cards

Unicast

A communication method involving one sender transmitting data to a single specific destination.

29
New cards

Multicast

A communication method where a single sender transmits packets to an entire subscribed group of hosts.

30
New cards

Broadcast

A communication method where a single sender transmits data to all devices located within the local broadcast domain.

31
New cards

Ethernet

A family of wired LAN technologies standardized as IEEE 802.3 defining MAC addressing, frame structures, and physical signaling.

32
New cards

Half Duplex

A transmission mode allowing bidirectional communication, but only in one direction at a time.

33
New cards

Full Duplex

A transmission mode that allows simultaneous bidirectional transmission and reception of data.

34
New cards

Internet Protocol (IP)

A connectionless, best-effort Layer 33 protocol responsible for packet addressing and routing across networks without ordering or delivery guarantees.

35
New cards

Socket

An operating system communication endpoint referenced in C by a file descriptor and associated with an IP address and a port number.

36
New cards

Network Address Translation (NAT)

A router technique that rewrites IP addresses (and ports in NAPT/PAT) to allow multiple private hosts to share a public IPv4 address.

37
New cards

Loopback Address

The IPv4 address 127.0.0.1 (within the reserved 127.0.0.0/8127.0.0.0/8 block) where network traffic is routed internally back to the local host machine.

38
New cards

Private IPv4 Address Ranges

Reserved, non-globally routed address ranges: Class A (10.0.0.0 to 10.255.255.25510.0.0.0\text{ to }10.255.255.255 or /8/8), Class B (172.16.0.0 to 172.31.255.255172.16.0.0\text{ to }172.31.255.255 or /12/12), and Class C (192.168.0.0 to 192.168.255.255192.168.0.0\text{ to }192.168.255.255 or /16/16).

39
New cards

Well-Known Ports

System port numbers ranging from 00 to 10231023, including SSH (2222), DNS (5353), HTTP (8080), and HTTPS (443443).

40
New cards

Network Byte Order

Big-endian format used in network protocols where the most significant byte of a multibyte value is transmitted or stored first.

41
New cards

htons() and htonl()

C conversion functions declared in translating 16-bit16\text{-bit} and 32-bit32\text{-bit} integers from host byte order to network byte order.

42
New cards

ntohs() and ntohl()

C conversion functions declared in translating 16-bit16\text{-bit} and 32-bit32\text{-bit} integers from network byte order to host byte order.

43
New cards

struct sockaddr_in

A C socket address structure in for IPv4, featuring fields: sin_family = AF_INET, sin_port (network byte order), and sin_addr.

44
New cards

socket()

A C system call taking domain, type, and protocol parameters that allocates a network communication endpoint and returns its file descriptor, or −1-1 on error.

45
New cards

bind()

A C system call that binds a socket file descriptor to a local IP address and port number, returning 00 on success or −1-1 on error.

46
New cards

connect()

A C system call that establishes an active TCP connection to a peer socket address, or assigns a default peer address for UDP without a handshake.

47
New cards

listen()

A C system call that transitions a connection-oriented socket into a passive state ready to queue incoming connection requests up to a specified backlog length.

48
New cards

accept()

A C system call that extracts the first connection request from a passive socket queue and creates a new connected socket descriptor, returning −1-1 on failure.

49
New cards

send() and recv()

C library functions used to transmit and receive stream or datagram bytes; recv() returning a count of 00 on TCP signals an orderly peer shutdown.