Unit 3 Flashcards
(38 cards)
What are the 4 intra-network layers?
Physical layer
Data link layer
Network layer
Transport layer
Describe the physical layer (intra-network)
- Service
– Move data on physical connections - Interface
– Send the bits provided - Protocols
– Many (voltages, pinouts, timings,
frequencies, etc) - Examples
– Coaxial, CAT5/6, radio waves
Describe the data link layer (intra-network)
- Service
– Organize bits into frames
– Transmit bits across direct connections - Interface
– Send bits to another machine - Protocols
– Media Access Control (MAC) - Examples
– Ethernet, 80.11 standards
Describe the network layer (intra-network)
- Service
– Transmit bits across indirect
connections - I.e., to machines not directly connected
- Interface
– Send bits to a specified address - Protocols
– Global addressing and routing - Examples
– Internet Protocol (IP)
Describe the transport layer (intra-network)
- Service
– Organize bits into packets
– Send bits between hosts - Interface
– Send bits to a host - Protocols
– Flow control, congestion management,
reliability - Examples
– TCP and UDP
Which intra-network layer(s) acknowledge every machine in the network?
physical layer, data link layer, network layer
Which intra-network layer(s) abstract to their host?
Transport layer: the endpoints of a communication; the route (and intermediaries) used to connect hosts are invisible above this level
Describe the session layer
- Service
– Open, maintain, and close connections - Interface
– Open, send, receive, close - Protocols
– Naming, organizing, mux/unmux - Examples
– Berkeley sockets, SOCKS
Describe the presentation layer
- Service
– Format data for transmission - Interface
– Send this data over the network - Protocols
– Encodings, endianness, encryption - Examples
– ASCII, Unicode, JSON
What is a Switch?
A switch is the central hub of network
Switches rout traffic via MAC address
What is a router and what does it do?
A network’s out-facing connection to other networks
Routers interact with routers on other networks
- they interact with the routers they have direct physical connections to
- routers communicate to establish reachability (they know and share the addresses contained in their network, they learn and share the addresses on networks they connect to directly, they propagate addresses they can reach indirectly)
True or False: In OOP languages, sockets are almost always classes
True
What is a network socket?
An abstraction of a physical socket on a computer
A data object representing that connection; each side of a network connection has a local socket object
True or False: sockets implement the transport layer and use the session layer
False
Sockets implement the session layer, so they use the transport layer
Which two types of data are used by socket connections?
Network address (IP) of a machine
The port number of a particular machine
What are socket connections uniquely identified by?
The remote IP address and the remote port number
The local IP address and the local port number
What is a port number used for?
An IP address identifies a single computer but there may be multiple processes using network traffic on that computer
Port number is used to divide traffic within a single computer
What is the socket communication pattern?
Establish a connection: server listens/waits for incoming connection requests, the client connects to the server
Communicate: server and client speak/listen according to established protocol
End a connection: both server and client close socket
What does java.net.ServerSocket do?
- Used in server-side applications
– Established before any active
connection - Represents a listener
– Binds to a specific port
– Awaits connection requests and accepts them - Produces a Socket when connection is established
– Used from that point onward to interact with client
What does java.net.Socket do?
- Used in server-side and client-side
applications - Represents a connection
– The local endpoint of the
communication - Provides basic I/O to the other side
– A (byte) InputStream
– A (byte) OutputStream
What are the subtypes of SocketException?
BindException : the port you asked for is unavailable
ConnectException : the hostname/port specified didn’t respond
NoRouteToHostException : routing to the machine itself failed
UnkownHostException : a failure of DNS resolution on your String hostname
Differences between a program and a process
Program
* Instructions and data
– Written and compiled/interpreted
– Stored on disk
* A passive entity
– Running a program requires creating a
process
* Can be associated with multiple
processes
Process
* “Program in execution”
– Loads program into memory to execute
– Includes run-time data and resources
* An active entity
– Carrying out instructions
– Interacting with data
* Associated with a single program
– Instructions copied into process memory
What does a scheduler do?
Manages time-sharing between processes
Process to process communication is…
restricted to explicit message passing; requires system level resources and involvement
Significantly slower than direct memory access