Computer Neworking:a Top-down Approach

Source: Internet
Author: User
Tags ack

[TOC]

This book is the best introduction of computer network books, and the traditional computer network books, it used a top-down way to explain. Thanks to two excellent Jim Kurose and Keith Ross, their vivid narrative makes me feel that the computer network is so interesting. There are 33 pages of citations alone, and I admire people who are so rigorous and patient.

Keep those cards and letters coming! --Proverbs

Chapter 1:computer Networks and the Internet

An overview of the computer network depicts the blueprint of the book. Borad Picture,to See the forest through the trees. This is an introduction to the chapter, covering a lot of basic knowledge and computer network of many convenient, but also did not lose focus. Introductory Chapter,without losing sight of the big picture.

1. What is the Internet? 1.1 A nuts-and-bolts Description basic Feature description

Defined:

The Internet is a computer network, interconnects hundreds of millions of computing devices the world.
In short, device interconnection.

These unconventional devices, such as laptops, smartphones, game consoles, cameras, and environmental sensors, are like being hooked up by a computer network (hooked up). In the terminology of the Internet (jargon), these devices are called hosts or end systems (terminals). Terminal access to the Internet through Internet Service Providers (ISPs), as well as local ISPs, such as China Telecom.

Packets = Header bytes + data bytes
So why is the network byte order a big endian? Because the byte header is to be transferred first.

1.2 A Service Description

The Internet as an infrastructure this provides service to applications.

Definition of the protocol:

A Protocol defines the format and the order of messages exchanged between, or more communicating Entities,as W Ell as the actions taken on the transmision and/or receipt of a message or other event.

Proficient in the nature of computer networks:

Mastering the field of computer networking is equirvalent to understading what, why, and how of networking protocols.

2. The Network Edge

End systems-at edge of the Internet
Why is end systems also known as the hosts?

Because they host (that's, run) application programs such as a Web browser program, and e-mail client program, or an E-mai L Server program.
In this book, host = End system.
Hosts is somnetimes further divided into the categories: clients and servers.

Note, do not assume that the server is not a terminal or host, although they provide services (search engines, mailboxes, etc.), but for the internet, they are not different from other terminals, are running the application. Servers has a large data center on the server side, and Google has 30-50 data centers that provide hundreds of thousands of services.

Home Network access:

DSL mode
Why is the usual upstream rate and downlink rate usually different?

Because the downstream and Upstrean transmission rates is diffent,the access was said to be asymmetric.
DSL has DSL modern, outside and telephone hanging on the same separator.

Cable Internet access Mode
Cable cables are often used by television companies to build Internet access. The most common is coaxial cable (coaxial CaBLE) + fiber mixing method, a coaxial cable to hang multiple users, coaxial cables connected to the fiber node, in addition to fiber transmission.
It also needs a special modems, called cable modems. An important and typical feature of this is that it is a shared broadcast medium. Packets sent or received will be uploaded or downloaded to each user of the same channel.

FTTH (Fiber to the home) fiber to the household
Each user has a ont (optical network Terminator), and multiple users (typically less than 100) are connected to the same upper splitter (optical splitter) via fiber optics. Optical splitter is connected to the Olt (Optical line terminal) via fiber optics, and the optical line terminals are then connected to the Co (central office) of the telco company.

Enterprise Network access:

LAN = local Area network,
A basic router + Ethernet switch, all devices are connected directly to the Ethernet switch.

Physical media

Each medium does not need to delve into, always remember: each medium limits its own network transmission capacity, transmission speed and transmission distance.

3. The Network Core

There are two basic ways to move data through network links and switches: Packet forwarding and circuit switching.

3.1 Packet Switching
    • Store-and-forward transmission storage and forwarding transfer
    • Queuing Delays and Packet Loss
    • Forwatding Tables and Routing protocols
3.2 Circuit switching

In the connection-oriented way, before the communication between the two parties, a communication circuit with fixed bandwidth needs to be assigned to both parties, and the communication is used to occupy the allocated resources during the communication process until the end of communication.
In a circuit-switched network, the resource needs to occupy one path, including the Buffer,link transfer ratio on the path, and the duration of the session needs to be preserved between the two terminals. A traditional telephone network is a circuit-switched network. Do not assume that the network is just the Internet, telephone network is also a network.

Advantages: The user can guarantee the stability of the session, real-time strong, small delay, low cost of switching equipment.
Disadvantage: The bandwidth utilization is low, once the circuit connection is established, regardless of communication or not will occupy the communication.

There are two ways to implement circuit switching in one link:
FDM Frequency Division Multiplexing and TDM time Division multiplexing

4.delay,loss,and throughput in packet-switched Networks
    • Processing delay of nodal processing delay node $$<10^-6$$
    • Queuing delay delay queueing delay $$10^-6-10^-3$$
    • Transmission delay transmit delay $$10^-6-10^-3$$
    • Propagation delay propagation delay $ $d/s$$ s = speed, less than the speed of light, about 2/3 of the light

The transmit delay is the delay from the node to the transmission medium, sending the delay = data/bandwidth. is related to the speed of the equipment's boat stay.

The transmission delay and packet size do not matter, depending on the distance and the transfer rate. Propagation delay = transmit distance/propagation rate fixed at the rate of transmission in a medium.

End-to-end delay End-to-end latency

Dend-end = N (dproc + Dtrans + dprop)
where Dtrans = L/R = Packet Size/rates

Chapter 2:application Layer Application Layers

This chapter is mainly about application layer protocol, too lazy to write, trouble, hinder the speed of reading. Pick what you think is important to write.

1. Inter-process communication (P88)

In the operating system, the nature of the application is the process, and different processes are unavoidable to communicate. Essentially, the communication between the Internet client and the server is implemented through the process. Here we only focus on the network running between different two hosts in the process of communication.

An analogy:
There is a house, the house has a door. We visit this House and always go through the door to visit.
ProcessIt's like a house, Socket it's like a door.

SocketDescribes the interface between the application layer and the transport layer, which is created by the network application. When a datagram from the transport layer is delivered to the upper layer of the application, it always wants to give it to a particular application, so there is Socket . Application layer Development This only concerns the application layer side Socket , not the transport layer. At most, select the protocol for the Transport layer, or set some transport layer parameters, such as the largest buffer and the size of the message segment.

A more subtle metaphor:

    • Think of a big dam with a transport layer on one side and an application layer on the other. There are many holes in the dam for water. Each application will have a single hole for sending and waiting for the water to receive, while the other side is the transport layer.
    • It's like the ancient emperor was flipping the sign.
How to identify the process of sending and receiving:
    1. Host's address--IP address
    2. Recognition symbols for sending and receiving processes--port number
2. Secure Transport Layer Protocol (P94)

The two most famous protocols for the transport layer are TCP and UDP, but neither of them is encrypted. If the application sends a plaintext password, and the package is captured by someone else, then there may be a security issue.

So just think of ways to strengthen the TCP protocol, there is Secure sockerts layrer (SSL), SSL is not the third Transport layer protocol, in the same level of TCP and UDP, but the TCO and UDP protocol strengthening, responsible for encryption, data integration, Endpoint authentication.

This enhancement is implemented by the application layer, especially if an application wants to use the SSL service, it requires code that contains SSL (highly optimized classes and libraries). SSL has its own socket API , assuming that the application layer uses a plaintext password, then SSL encrypts it, and the SSL of the receiving room decrypts it.

Using Wireshark to study HTTP protocols

3.Web Caching (p110)

Web Caching = Proxy Server

    1. Can substantially reduce the response time
    2. Reduce WEB traffic in the Internet as a whole
4.Distributed Hash Tables (dhts)

Simple Databash in a-peer Network,key-value.

    • Key:content names (e.g. names of movies, albums, and software)
    • Value:ip Address
5.Socket programming:creating Network Applications

Wrote a UDP simple c/s application, placed in the blog park.
Http://www.cnblogs.com/crb912/p/9060670.html

One of the most important places in the + + book (p163) is that UDP and TCP sockets are programmed differently than + +:
Is UDP is no connection, every time you read and write a socket, you need to join the host address, receive data is also two parameters (data, addr). TCP sockets do not need to do this, because it is a connection-oriented, when reading and writing based on the connection of the socket, only need to read and write data directly. Instead of needing attention to join and accept this target host address. Because the TCP protocol has helped you establish a dedicated connection.

6.Sockt Programming Assignmentassignment 1:web Server
    1. Connections accepted by the client
    2. Accept this connection.HTTP request
    3. Parse the file for this request
    4. Get this file from the server's file system
    5. Create a HTTP response message that contains the file for this request
    6. Send this response file, if this file is not stored in the file system of the server, then return404 Not Found

I didn't do this job myself, 73826062 this article helped me very well. It feels like if I wrote it myself, I might not be able to write it because I didn't understand the HTTP response, and I didn't even think html of writing the file to the TCP connection.

Assignment 2:UDP Pinger

Experimental content: A Ping tool based on the UDP experiment.

Links to Topics: https://wenku.baidu.com/view/ed19e6cce2bd960591c677d2.html
I wrote the answer on the blog park: https://www.cnblogs.com/crb912/p/9082379.html

Assignment 3:mail Client

There's no interest in this experiment, just skip it.

Assignment 4:multi-threaded Web Proxy

This experiment requires the implementation of a Web Proxy (Web proxy), a 浏览器 request to the Proxy Web page, and then Web Proxy to the origin server request page, the results of the request returned to the Web Proxy browser, and eventually return.
The difficulty lies in: Data Flow and multithreading https://www.cs.rochester.edu/~kshen/csc257-fall2009/assignments/assignment1.html

Chapter 3:transport layermultiplexing and demultiplexing

Defined:

Each trasport-layer segment have a set of fields in the segment for this purpose. At eceiving end, the transport layer examines these indentify the receiving socket and then directs the segment Cket. This job of delivering the data in a tranport-layer segment to the corrent socket is called dumultiplexing. divided by
The job of gathering data chunks at the source host from different sockets, encapsulating each data chunk with header info Rmation (that would later be used in demultiplexing.) to create segments, and passing the Segmengts to the network layer is Called Multiplexing. Multiplexing

To summarize:
At the receiving end, the transport layer transmits the received segment to the corresponding socket, which is called the separation.
On the sending side, the different sockets from the upper layer need to be encapsulated into segment, and then pass the segment to the following network layer, which is called multiplexing.

About implementations:
In order for the transport layer to be divided, two conditions must be established:

    1. The sockets must has a unique identifiers. Identifier Unique
    2. Each segment must have a special field indication to tell which socket to pass to.

bind()Method can bind a socket to a specific port, which is good for the server side, but does not make much sense to the client.

The UDP socket is identified by a 2-tuple: Destination IP, Destination port
The TCP socket is identified by a 4-tuple: Source IP, source port, destination IP, destination port.

A socket is a means of process communication between two different computers on a network, and for the same host, it can have a large number of processes, each of which can have its own port, and is associated with a unique port. Remember: Socket = Network process Communication

If two UDP segment have the same destination IP and port, different source IP and port. Then the two Segmet will enter the same UPD socket into the same target process.

Safety

Vulnerable to attack due to port exposure. This is the case with the famous SQL Slammer worm worm virus. Because each socket has its own buffer, buffer overflow when it is attacked.

Building a Reliable Data transefer Protocol

This section is very important and tells you how to build a reliable data transfer protocol. This is a logical design, the author carefully consider three cases.

    • Transmission on reliable channel: rdt1.0
    • Transfer on channel with bit errors: rdt2.0
    • Transmission on lossy channel where bit errors is present: rdt3.0

In the third scenario, the error check has been considered, Timer, Sequence Number,ack, lost Bao and so on. This design is the key and core of the Transport layer protocol.

pipelined Reliable Data Transfer protocols

RDT3.0 is a functionally correct protocol, but no one is happy with its performance, especially in today's high-speed networks. RDT3.0 biggest problem is:stop-and-wait, it is a stop-wait protocol, which leads to its poor performance.

So how to implement a pipeline of reliable transmission protocol? This is an important thought in this section. Therefore, the design of:

    • Go-back-n (GBN) protocol, which has improved considerably relative to stop-and-wait and improved channel utilization, but the flaw persists: a single packet error can cause a large number of packets to be re-transmitted.
    • Selective Repeat (SR) protocol it will only retransmit lost packets.

After describing these two design patterns, TCP is introduced, and TCP is an example of this design pattern implementation. The TCP connection does not exist on a TDM and FDM circuit-switched network, nor on virtual circuits, but only in the two end system. Cerf and Kahn published papers on TCP/IP, and they were therefore awarded ACM's Turing Award in 2004. TCP provides duplex services, Full-duplex service.

The application layer's SSH protocol and the Telnet protocol, the next layer uses TCP, but Telnet uses the plaintext password at the transport layer.

Safety

Because TCP connections require ' Three-way-handshake ', SYN is needed to build, so a SYN flood attack precautionary approach is simple: Yes SYN cookies . When the transport layer receives a segment, it executes a hash function, resulting in a eigenvalues. Next, if the ACK is found to be invalid, then this may be a harmful package. Each subsequent packet will be executed in a hash operation. If it is not valid, it is discarded.

Principle of congestion Control

The principle of congestion control, broadly speaking, congestion control needs to be implemented from two places:

    • End-to-end congestions Control
    • Network-assisted Congestion Control
      Then the TCP congestion control introduced in the next section: addition increases, multiplication decreases
Summarize

At the beginning of this chapter, we learned the services that the Transport Layer protocol can provide to network applications. At some extreme, the transport layer can be very simple to provide to the application layer a non-decorated (no-frill) service. UDP is a typical example of a non-decorated service. From the other extreme, the outgoing layer can also provide an application layer with a large number of guaranteed services, such as reliable transmission, delay assurance, bandwidth assurance, TCP is such an example. Otherwise, the transport layer can only rely on the next layer of network layer to provide these guarantees for it. The network layer does not do these, so these are implemented by the transport layer.

ACK response to ensure the reliable transmission of data, timer limit in the time to answer, re-rotating is the key to ensure that SEQ facilitates the determination of retransmission segment. TCP is far more complex than we think, a lot of TCP patches, fixes, various versions of TCP implementations. In particular, TCP congestion control has evolved for many years and continues to evolve. Other protocols are also present in the Transport layer:

    • The DCCP class is UDP, but the application layer can choose whether it is reliable or semi-reliable.
    • SCTP reliable service. Allow the application layer's ' Streams '
    • TFRC tcp-friendly Rate Congtrol Protocol

It is only time to verify that these transport layer protocols will be widely deployed in the future! Although these protocols are a strong version of TCP and UDP, the performance of TCP and UDP over the years has been sufficient to "good enough" and whether people will abandon "better" and choose "Good better", depending on the complex: mix of technical, social and business considerations.

Chapter 4 Network layers Layer

Computer Neworking:a Top-down approach

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.