Intro To Network Flashcards
Network Introduction
Typical Network Setup
SOHO & Enterprise Network form mostly via Ethernet, Wireless
Networking model, architecture or blueprint
Defines a comprehensive set of documents, each document describes one small function required for a network
Network protocol
Set of logical rules that devices must follow to communicate
5 Layer TCP/IP Model
Application, Transport, Network, Data-link, Physical (ATNDP)
Physical Layer
Focuses on how to transmit bits over each individual link
Network Layer
Focuses on delivering data over the entire path from the original sending computer to the final destination computer
Example Protocols, Application? Transport? Internet? Data Link & Physical?
Application - HTTP, POP3, SMTP
Transport - TCP, UDP
Internet - IP, ICMP
Data Link & Physical - Ethernet, 802.11 (Wi-Fi)
Application Layer Purpose?
Provide services to the application software running on computer, does not define the application itself, but it defines services that applications need.
Eg. HTTP defines how web browsers can pull the contents of a webpage from a web server
HTTP Mechanism
A protocol which emphasizes the exchanged of messages between client and server to obtain webpages
HTTP Flows:
1. Open a TCP connection, the TCP connection is used to send a request, or several, and receive an answer. The client may open a new connection, reuse an existing connection or open several TCP connections to the servers
- Send an HTTP message: HTTP messages (before HTTP/2) are human readable. With HTTP/2, these simple messages are encapsulated in frames, making them impossible to read directly, but the principle remains the same. Eg.
GET / HTTP/1.1
Host: developer.mozilla.org
Accept-Language: fr
3. Read the response sent by the server, such as: HTTP/1.1 200 OK Date: Sat, 09 Oct 2010 14:28:02 GMT Server: Apache Last-Modified: Tue, 01 Dec 2009 20:18:22 GMT ETag: "51142bc1-7449-479b075b2891b" Accept-Ranges: bytes Content-Length: 29769 Content-Type: text/html
here comes the 29769 bytes of the requested web page)
- Close or reuse the connection for further request
If HTTP pipelining is activated, several requests can be sent without waiting for the first response to be fully received.
Types of HTTP messages
HTTP messages are how data is exchanged between a server and a client. Two types of messages; requests sent by the client to trigger an action on the server; responses the answer from the server
Encoded in ASCII, and span over multiple lines
HTTP Message Structure
- A start-line describing the requests to be implemented, or its status of whether successful or a failure. This start-line is always a single line.
- An optional set of HTTP headers specifying the request, or describing the body included in the message.
- A blank line indicating all meta-information for the request has been sent.
- An optional body containing data associated with the request (like content of an HTML form), or the document associated with a response. The presence of the body and its size is specified by the start-line and HTTP headers.
HTTP Requests
HTTP requests are messages sent by the client to initiate an action on the server
Start line contains:
1. HTTP method, a verb (GET, PUT or POST) or a noun (like HEAD or OPTIONS), that describes the action to be performed. For example, GET indicates that a resource should be fetched or POST means that data is pushed to the server
- The request target, usually a URL
POST / HTTP/1.1
GET /background.png HTTP/1.0
HEAD /test.html?query=alibaba HTTP/1.1
OPTIONS /anypage.html HTTP/1.0
- HTTP version, defines the structure of the remaining message, acting as an indictor of the expected version to use for the response
Headers:
HTTP headers from a request follow the same basic structure of an HTTP header, a case insensitive string followed by colon and a value whose structure depends upon the header.
Types of headers
- General headers, like Via, apply to the message as a whole
- Request headers like User-Agent, modify the request by specifying it further, by giving context (like Referer) or by conditionally restricting it (like If-None)
- Representation metadata headers, like content-length that describes the encoding and format of the message body (Only present if the message has a body)
Body:
Not all requests have one, requests fetching resources, like GET, HEAD, DELETE or OPTIONS usually dont need one. Mostly used in POST requests
Categories:
- Single resource bodies, consisting of one single file, defined by the two headers: Content-Type and Content-Length
- Multiple resource bodies, consisting of a multipart body, each containing a different bit of information, Typically associated with HTML Forms
HTTP Responses
Status line
1. Protocol version, usually HTTP/1.1
- Status code, indicating success or failure of the request. Common status code are 200, 404 or 302
- Status text, A brief, purely informational, textual description of the status code to help a human understand the HTTP message
Headers:
Similar to HTTP requests
Body:
- Not all responses have one: responses with a status code that sufficiently answers the request without the need for corresponding payload (201 Created or 204 No Content) usually dont
CCNA, HTTP
- To get the webpage from a server, Bob sends a message with an HTTP header. Protocols use headers as a place to put information used by that protocol
- Response from server than return a message beginning with an HTTP header which contains a return code (200). HTTP defines other return codes so that the server can tell the browser whether the request worked.
- Subsequent message are then sent from server to client without an HTTP header. HTTP transfer the data by sending multiple messages, each with a part of the file.
Transport Layer
Includes only a small amount of protocols
Commonly used protocol: TCP, UDP
Provide services to the application layer protocols
TCP
A transport layer protocol which provides reliable, ordered, and error checked delivery of a stream of bytes between applications running on hosts communicating via an IP network. A connection oriented protocol
Operation of TCP
Focuses on a few attribute, Windowing, Acknowledgement, Flow Control
Flow Control, If the receiving system is being sent more information than it can process, it will ask the sending system to stop for a short time. The packet sent telling the other device to stop is known as a source quench message
Windowing, a mechanism which each system agrees upon how much data is to be send before an acknowledgement is required.
Acknowledgements, when a certain amount of segments is received, the fact that they all arrived safely and in the correct order needs to be communicated to the sending system. All packets sent contains a sequence number for ordering. If a packet is dropped, a request is sent to re-transmit the packet
Three way handshake
The client ( initiating side ) sends a segment with a SYN flag set and the proposed initial sequence number in the SEQ number field ( SEQ = x ).
On receiving this, the server ( responding side ) notes the SEQ number setting for the incoming direction and then returns a segment with both the SYN and ACK flags set with the SEQ number field ( SEQ = y ) set to its own assigned value for the reverse direction and a piggy backed acknowledgement field of X + 1 ( PACK = X + 1 ) to confirm it has noted the initial value for its incoming direction.
On receipt of this, the client ( initiating ) returns a segment with the ACK flag set and a piggybacked acknowledgement field of ( Y + 1 )
Same layer & Adjacent layer interactions
Adjacent layer interaction, Refers to the concepts of how adjacent layers in a networking model, on the SAME computer, work together
Same layer interaction, When a particular layer on one computer wants to communicate with the same layer on another computer, the two computers use headers to hold the information that they want to communicate
UDP
A connectionless protocol, Numbers each packet and then sends them to their destination. Never checks to see whether they arrived safely and will never set up a connection before sending the packet.
Contention between UDP & TCP
TCP uses a lot of bandwidth on the network and there is a lot of traffic sent back and forth to set up the connection even before the data is sent. Takes up valuable time and network resources
UDP packets are alot smaller than TCP packets and they are very useful if a really reliable connection is not that necessary. Does not guarantee delivery
Network layer
takes the segments from transport layer and break them down into smaller units called packets.
Network layer determine the best path to take from one network to another. Routers work on this layer. Use logical addressing here. IP addressing
Purpose of IP
IP defines that each host computer should have a different IP address.
Defines the process of routing so that devices called routers can work like the post office, forwarding packets of data so that they are delivered to the correct destinations
Defines the details of how a network infrastructure should be created so that the network can deliver data to all computers in the network
Also defines how to group addresses together
IP address is made up of 32 bit
IP routing basic
- Begins with server being ready to send an IP packet. IP packet will contain both destination and source IP address. Server’s IP process chooses to send the packet to some router.
- Router r1 receives the IP packet and R1 routing table process the IP address and makes a decision. R1 looks at the destination address and compare it within its routing table. And chooses to forward to the next IP router.
- Router r2 repeat the same kind of logic used by r1.
- This process occurs until the packet is sent to its destination