Mid-Term Test Notes

Sockets

IP: stateless, unacknowledged, unreliable, unordered.

TCP/UDP add ports on top of IPv4 for addressing.

TCP/Stream:

UDP/Datagram:

API:

Network byte order: big endian.

Protocol Layering

Service access point: interface to service for higher layer.

| Header | Higher-layer payload/service data unit | Trailer |

OSI

Physical/Link layers single-hop scope.

Network layer use single-hops to achieve end-to-end communication.

Routers implement physical, link and network which are intentionally kept simple (and thus allows hardware implementations for high performance).

Physical:

Link:

Network:

Transport:

Session:

Presentation:

Application:

TCP/IP reference model: physical/network interface/internet/transport/application.

Transport:

Service Primitives

Confirmed service:

Unconfirmed: no response or confirm e.g. UDP.

Confirmed Delivery: Provider B sends PDU when request PDU received regardless what user B does.

Multiplexing:

Splitting:

Fragmentation:

Blocking:

Physical Layer

Passband transmission:

s(t)=A(t)cos[(fc+f(t))t+ϕ(t)] s(t)= A(t)\cdot cos[(f_c + f(t)) \cdot t + \phi(t)]

Where t is less than duration T, the symbol duration, A(t) is the amplitude, f(t) is the frequency offset, f_c is the center frequency and \phi(t) is the phase.

Quadrature Amplitude Modulation: varies amplitude and phase. n unique amplitudes and n unique phases for n^2 symbols. Greater throughput but higher error rate.

Carrier synchronization: synchronizes frequency and phase.

NRZ can lead to long runs of the same bit and loss of synchronization.

Manchester encoding: [-x, x] voltage range:

Frame synchronization, ethernet: preamble at start for carrier synchronization, then start-frame-delimiter.

End of frame detection: gap between frames, deliberate code violations, dedicated length fields, special flags (with escape codes).

LAN

Geometric RV:

Orthogonal: behavior of one station independent of another.

Frequency division multiple access:

Time:

Both require some way of allocating sub-channels/time slots.

Random access protocol: no central station/shared state.

ALOHA:

CSMA - carrier sense multiple access. Carrier sense: almost instantaneous check of if the medium is busy. Fails if time difference between two stations starting collisions is smaller than the propagation delay.

Non-persistent CSMA:

p-persistent CSMA:

1-persistent: CMSA/CD:

Ethernet

Manchester Encoding:

Length Name
7 Preamble
1 SOF
6 DstAddr
6 SrcAddr
2 Length/Type
46-1500 Payload
4 FCS

MAC address: 48 bit globally unique. If first of address is 1, multicast. Else, unicast address.

If L/T >= 1500, type field (e.g. IPv4, ARP) to allow for protocol multiplexing. Else, length field. Type assumed to be first two bytes of payload.

Broadcast: half-duplex, MAC needed, 10 Mbps PHYs.

MAC protocol: CSMA/CD:

IP

Big endian byte ordering

Length Name
Bytes 0-3
4 Version (=4)
4 Hdr Len (numBytes/4)
6 TOS/DSCP (zeros)
2 Unused (zeros)
16 TotalLength (bytes)
Bytes 4-7
16 Identification
3 Flags (0, DF, MF)
13 FragmentOffset (offset/8)
Bytes 8-11
8 Time-To-Live (usually 32/64)
8 Protocol Type
16 Header Checksum
Bytes 12-15
32 Source Address
Bytes 16-19
32 Destination Address
Bytes 20+
32n Options + Padding
Data

Last fragment has MF unset, and non-zero FragmentOffset to differentiate from an unfragmented packet.

Protocol type: determines higher-level protocol that generated the payload (e.g. UDP/TCP).

Routing table: map from destination address to output port.

Host address of all 0s: network as a whole being referred to. All 1s: broadcast address.

Lookup:

End hosts have default route + entry for each network it is directly connected to.

Core routers: know almost all internet networks, have no default routers.

Address Resolution Protocol: map from IP to MAC:

Internet Control Message Protocol - optional protocol used to inform sender of error.