*network concept* notes

http://netfilter.org/documentation/HOWTO


**network interface
We usually call each connection to a node a 'network interface', or 'interface' for short. Linux gives these names like 'eth0' for the first ethernet interface, and 'fddi0' for the first fiber interface.

**network link
The actual connection between 2 computers if often called a 'network link'. e.g. network cable.

**4 things care about when talk about a computer network
Size, Topology(The Shape), Physical( What It's Made Of), Protocol( What It's Speaking )

**Internet
'internetworking' refers to connecting separate networks to build a larger one, hence 'The Internet' is the connection of a whole pile of subnetworks.
The physical details are varied. The protocols spoken by each link are often different.
For the internet, the *network protocol* is the Internet Protocol(version 4), or 'IP'.
The link-level protocol descibes how to get from one node to another if they're connected directly; the 'network protocol' tells us how to get form one point in the network to any other, going through other links if necessary.

**router
A node which connects two or more networks is called a 'router': it will have one interface foreach network.

**protocol stack
[ Application: handles Porn ]
[ TCP: Handles Retransmission ]
[ IP: Handles Routing ]
[ Link: Handles A Single Hop ]
TCP or 'Transmission Control Protocol': over 90% of the Internet traffic today is TCP, as it is used for Web and EMail.

**This IP thing
Every interface on the network needs an 'IP address'.
xxx.xxx.xxx.xxx, each number is between 0 and 255.
Remember also that a router is a node with interfaces on more than one network, so the router will have one IP address for each interface.

**network address, network mask
There is a standard notation for groups of IP addresses, sometimes called a 'netwrok address'.
'1.2.0.0 - 1.2.255.255', '1.2' is netwrok address.
In '1.2.0.0/16', '/16' means first 16 bits are network address.
Another way of writing netmasks. '1.2.0.0/255.255.0.0'.

**DNS Domain Name System
Look up names, and return IP address. Humans are pretty bad at remembering numbers. So we can put 'www.linuxcare.com' into netscape, instead of '167.216.245.249'
We need the IP address of at least one of these 'name servers': usually these are kept in the '/etc/resolv.conf' file.

**port
Node with vary servers. This is where TCP and UDP have aconcept of 'ports', identify servers. A list of ports can be found in '/etc/services'.

**source port
Two windows are both accessing same web site, how Linux sort out the TCP packets coming back from the web server? This is where the 'source port' comes in. Every new TCP connection gets a different source port, so everyone can tell them apart. Usually the first source port given will be 1024, an will increase over time.

**Dailup Interfaces: PPP
'Point-to-Point Protocol' or 'PPP'. ISP Assign 'dynamic IP address'.

**The packets look like
IP packet: important fields are Protocol(TCP, UDP, etc), Source IP Address, Destination IP Address.
TCP packet: important fields are Source Port, Destination Port.

**Summary
So the modern Internet uses IP packets to communicate, and most of these IP packets use TCP inside. Special nodes called 'routers' connect all the little networks together into larger networks, and pass these packets through to their destination. Most normal machines are only attached to one network(ie. have only one interface), and so are not routers.

Every interface has a unique IP address, which look like '1.2.3.4': interfaces in the same network will have related IP address, with the same start, the same way that phone connection in the same area have the same prefix. These network addresses look like IP addresses, with a '/' say how much of them is the prefix, eg '1.2.0.0/16' means the first two digits is the network address: each digit represents 8 bits.

Machines are given names by the Domain Name Service: programs ask name servers to give them the IP address, given a name like 'www.linuxcare.com'. This IP address is then used as the destination IP address to talk to that node.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值