Important Terms
- links - medium that connects computers
- types of links
- point-to-point
- multiple-access
- types of links
- network - a set of computers/nodes connected together
- switches - nodes inside network - store and forward packets
- hosts - nodes outside network - runs applications that uses the network
- internetwork (internet) - set of independent networks (clouds) that are connected
- router/gateway - a node that is connected to multiple networks - same role as switch but forwards data across different networks
- address - each node is assigned an address
- routing - the process of forwarding messages to destination node based on address
- casting types
- unicast - single destination
- broadcast - to all nodes
- multicast - to subset of nodes
- constant bit rate (CBR) - source sends at constant rate (e.g. uncompressed voice)
- variable bit rate (VBR) - source sends at variable rates (e.g images)
Switched Networks
- circuit switching
- in contrast to packet switching, first establish dedicated “circuit” across a sequence of “links” then stream bits of data to destination node
- employed in telephone systems
- used in optical networking
- packet switching
- sends discrete “packets” of data using a strategy called “store-and-forward”
- majority of computer networks
- packet switching methodologies:
- virtual-circuit switching - similar to circuit switching, but built on top of a packet switching internetwork
- datagram switching - packets are called datagrams/packets and are routed independently through the network
- source routing - similar to datagram switching, but path is predetermined by sender in which gateways must adhere to
- message switching
Characterizing Networks by Size
Link to original
- NANO -
- NFC - near-field communication
- BAN - body area network
- PAN - personal area network
- SAN - storage/system area network
- LAN - local area network
- CAN - controller area network
- MAN - metropolitan area network
- RAN - radio access network
- WAN - wide area network
Some Requirements in Computer Networks
- Resource Sharing
- multiplexing
- taking multiple signals and combining them into one signal for transmission over a single medium
- types of multiplexing:
- synchronous time-division multiplexing (STDM)
- divide time into equal size which is to be shared
- problem - what happens when one doesn’t need it
- frequency-division multiplexing (FDM)
- transmit each flow at a different frequency
- code-division multiplexing (CDM)
- df
- statistical multiplexing
- resource shared over time (like STDM)
- data is transmitted on demand rather than predetermined time-slot
- to ensure all eventually get their share, max-size data is defined referred as “packet” therefore message is fragmented into several packets during transmission
- one of the issues that faces a network designer is how to transmit “packets” in a fair manner
- this could be done in:
- FIFO
- round robin - based on different flows
- sometimes a node (most often a switch) receive more than it can send. therefore memory is needed to buffer to overflow packets. however, if this continues, the switch will run out of memory and is forced to drop the packets. The switch in this state is considered “congested”
- this could be done in:
- synchronous time-division multiplexing (STDM)
- multiplexing
- Support Common Services
- types of services:
- request/reply - request webpages
- message stream - video conference
- real-time - gaming
- example application protocols:
- http - hypertext transfer protocol
- ftp - file transfer protocol
- nfs - network file system
- types of services:
- Reliability
- we want a computer network to be resilient to various errors
- 3 general classes of failure:
- bit errors
- rare but do happen
- packet error
- a complete packet is lost by the network
- main difficulties is distinguishing between “lost” and “late” packets
- node and link errors
- link is disconnected, node crashes
- main difficulties, is distinguishing between “cut” or “flaky” link
- main difficulties, is distinguishing between “failed” and “slow” computers
- bit errors
- Manageability
- networks need to be managed
- partly related to the issue of scalability
Network Architecture
network architectures - are general blueprints that guide the design and implementation of networks. Go over 2 architectures:
- OSI architecture
- TCP/IP architecture
Layering and Protocols
- the point of layering and protocols is for blackbox abstractions
- app programs
- process-to-process channels
- host-to-host connectivity
- hardware
- process-to-process channels can be split into
- request/reply channel
- message stream channel
- real-time channel
/cn---chapter-1---foundation/1.png)
/cn---chapter-1---foundation/2.png)
- each protocol has 2 interfaces:
- service interface
- peer-to-peer interface
/cn---chapter-1---foundation/3.png)
OSI Architecture
Open Systems Interconnection (OSI) partitions network functionality into 7 layers
- physical
- handles transmission of raw bits over a link (wireless or wired)
- data-link
- here data is called frame
- collects stream of bits over “link”
- network
- here data is called packet
- handles routing among nodes within a packet-switched network
- transport
- here data is called message
- implements “process-to-process” channel
- session
- presentation
- application
see more: Networking Layers - Open Systems Interconnection (OSI) Model
Internet Architecture
/cn---chapter-1---foundation/4.png)
also known as TCP/IP architecture
evolved out of its predecessor ARPANET
- Physical and Data-link Layer 1 and 2
- IP Layer 3
- supports interconnection of multiple networking technologies into a single, logical internetwork
- Transport Layer 4
- Application Layer 5
- (e.g. HTTP, FTP, Telnet (remote login), SMTP, etc)
Implementing Network Software
/cn---chapter-1---foundation/5.png)
Application Programming Interface (Sockets)
application programming interface (API) is an interface provided by the OS. Some types include:
- socket interface
keep in mind:
- protocol provides a certain set of services
- API provides a syntax that invokes those services
Steps of Socket
- create socket
- int socket(int domain, int type, int protocol)
- domain
- specifies the protocol “family” to be used
- PF_INET - denotes Internet family
- PF_UNIX - denotes Unix pipe facility
- PF_PACKET - denote direct access to network interface (bypass TCP/IP protocol stack)
- specifies the protocol “family” to be used
- type
- denote semantics of the communication stream
- SOCK_STREAM - denote byte stream
- SOCK_DGRAM - denote message-oriented service
- denote semantics of the communication stream
- protocol
- identifies specific protocol to be used
- UNSPEC - unspecified
- identifies specific protocol to be used
- domain
- int socket(int domain, int type, int protocol)
- for server machine, perform “passive” open (listen for connections)
- the server does this by invoking the following 3 operations:
- int bind(int socket, struct sockaddr *address, int addr_len)
- int listen(int socket, int backlog)
- int accept(int socket, struct sockaddr *address, int *addr_len)
- bind operation
- binds newly created socket to specified network address (IP address and TCP port number)
- ports are used to indirectly identify processes (also a form of “demux keys”)
- listen operation
- defines how many connections can be pending on specified socket
- accept operation
- carries out passive open
- is a blocking operation and does not return until remote participant has connected
- returns a new socket that corresponds to the just-established connection
- address argument - contains the remote participant address
- when accept returns, the original socket that was given as an argument still exists and still corresponds to passive open; it is used in future invocations of accept
- the server does this by invoking the following 3 operations:
- for client machine, perform “active” open
- says who to connect to by invoking
- int connect(int socket, struct sockaddr *address, int addr_len)
- connect operation
- blocking operation until TCP established connection
- address argument - remote participant’s address
- says who to connect to by invoking
- both server and client
- once connection between server and client is established, application invokes the following 2 operations to send and receive data:
- int send(int socket, char *message, int msg_len, int flags)
- int recv(int, socket, char *buffer, int buf_len, int flags)
- once connection between server and client is established, application invokes the following 2 operations to send and receive data:
Performance
network performance is measured in 2 fundamental ways:
- bandwidth (throughput)
- number of bits that can be transmitted over the network at a certain period of time
- example: 10 million bits per second
- latency (delay)
- how long it takes a message to travel from end to end
- example: 24 milliseconds
- the are times when we want to know the “round-trip time” RTT of a network
- total latency
- latency = propagation + transmit + queue
- propagation = distance / speed of light
- transmit = size / bandwidth
- where:
- distance - is length of wire
- speed of light - effective speed of light over the wire
- size - size of packet
- bandwidth - bandwidth of which the packet is transmitted
latency x bandwidth product (lb-product)
- to calculate the capacity of a channel, we calculate the latency x bandwidth priduct
- i.e. the lb-product of a channel with: one-way latency of 50ms and bandwidth of 45Mbps
- lb-product = (latency) x (bandwidth)
- lb-product = (50 x 10⁻³seconds) x (45 x 10⁶bits/seconds)
- lb-product = 2.25 x 10⁶bits