]]>Dos Attackhttp://www.tkk7.com/czihong/articles/379260.htmlChan ChenChan ChenFri, 25 May 2012 18:44:00 GMThttp://www.tkk7.com/czihong/articles/379260.htmlhttp://www.tkk7.com/czihong/comments/379260.htmlhttp://www.tkk7.com/czihong/articles/379260.html#Feedback0http://www.tkk7.com/czihong/comments/commentRss/379260.htmlhttp://www.tkk7.com/czihong/services/trackbacks/379260.html什么是DoSd 那么Q?/span>DoS到底是什么?接触PC早的同志会直接想到微软磁盘操作系l?/span> ?/span>DOS--Disk Operation SystemQ哦Q不不不Q我看盖茨可不像是黑客的老大哟!?/span>DoS非彼DOS也,DoS?/span>Denial Of ServiceQ拒l服务的~写?/span>DoS是指故意的攻ȝl协议实现的~陷或直接通过野蛮手段D忍地耗尽被攻d象的资源Q目的是让目标计机或网l无法提供正常的服务或资源访问,使目标系l服务系l停止响应甚臛_溃,而在此攻Mq不包括侵入目标服务器或目标|络讑֤。这些服务资源包括网l带宽,文gpȝI间定wQ开攄q程或者允许的q接。这U攻MD资源的匮乏,无论计算机的处理速度多快、内存容量多大、网l带宽的速度多快都无法避免这U攻d来的后果。要知道M事物都有一个极限,所以总能扑ֈ一个方法h的值大于该极限|因此׃故意D所提供的服务资源匮乏,表面上好象是服务资源无法满需求。所以千万不要自认ؓ拥有了够宽的带宽和_快的服务器就有了一个不?/span>DoSd的高性能|站Q拒l服务攻M使所有的资源变得非常渺小?/span> 其实Q我们作个Ş象的比喻来理?/span>DoS。街头的馆是ؓ大众提供饮服务Q如果一地痞流氓要DoS馆的话Q手D会很多Q比如霸占着桌不结账,堵住馆的大门不让\Q骚扰餐馆的服务员或厨子不能q活Q甚x恶劣……相应的计机和网l系l则是ؓInternet 用户提供互联|资源的Q如果有黑客要进?/span>DoSd的话Q可以想象同h好多手段Q今天最常见?/span>DoSd有对计算机网l的带宽d和连通性攻凅R带宽攻L以极大的通信量冲ȝl,使得所有可用网l资源都被消耗殆,最后导致合法的用户h无法通过。连通性攻L用大量的q接h冲击计算机,使得所有可用的操作pȝ资源都被消耗殆,最l计机无法再处理合法用Lh?/span> 什么是DDoS
传统上,d者所面的主要问题是|络带宽Q由于较的|络规模和较慢的|络速度的限Ӟd者无法发多的h。虽然类?/span>"the ping of death"的攻ȝ型只需要较量的包可以摧毁一个没有打q补丁的UNIXpȝQ但大多数的DoSdq是需要相当大的带宽的Q而以个h为单位的黑客们很难用高带宽的资源。ؓ了克服这个缺点,DoSd者开发了分布式的d。攻击者简单利用工具集合许多的|络带宽来同时对同一个目标发动大量的dhQ这是DDoSd?/span> DDoSQ?/span>Distributed Denial Of ServiceQ又?/span>DoS又向前发展了一大步Q这U分布式拒绝服务d是黑客利用在已经侵入q已控制的不同的高带宽主机(可能是数百,甚至成千上万収ͼ上安装大量的DoS服务E序Q它们等待来自中央攻L制中心的命oQ中央攻L制中心在适时启动全体受控L?/span>DoS服务q程Q让它们对一个特定目标发送尽可能多的|络讉KhQŞ成一?/span>DoSz流冲击目标pȝQ猛烈的DoSd同一个网站。在寡不敌众的力量抗衡下Q被d的目标网站会很快失去反应而不能及时处理正常的讉K甚至pȝ瘫痪崩溃。可?/span>DDoS?/span>DoS的最大区别是人多力量大?/span>DoS是一台机器攻ȝ标,DDoS是被中央d中心控制的很多台机器利用他们的高带宽d目标Q可更容易地目标网站攻下。另外,DDoSd方式较ؓ自动化,d者可以把他的E序安装到网l中的多台机器上Q所采用的这U攻L式很难被d对象察觉Q直到攻击者发下统一的攻d令,q些机器才同时发赯攅R可以说DDoSd是由黑客集中控制发动的一l?/span>DoSd的集合,现在q种方式被认为是最有效的攻dŞ式,q且非常难以抉|?/span> 无论?/span>DoSdq是DDoSdQ简单的看,都只是一U破坏网l服务的黑客方式Q虽然具体的实现方式千变万化Q但都有一个共同点Q就是其Ҏ目的是受害L或网l无法及时接收ƈ处理外界hQ或无法及时回应外界h。其具体表现方式有以下几U: 1Q制造大量无用数据Q造成通往被攻M机的|络拥塞Q被攻M机无法正常和外界通信?/span>
拒绝服务d是一U对|络危害巨大的恶意攻凅R今天,DoSh代表性的d手段包括Ping of Death?/span>TearDrop?/span>UDP flood ?/span>SYN flood?/span>Land Attack?/span>IP Spoofing DoS{。我们看看它们又是怎么实现的?/span>
M?/span> ping ( ping of death ) Q?/span>ICMP (Internet Control Message ProtocolQ?/span>Internet控制信息协议)?/span>Internet上用于错误处理和传递控制信息。它的功能之一是与L联系Q通过发送一?/span>"回音h"Q?/span>echo requestQ信息包看看L是否"zȝ"。最普通的pingE序是q个功能。而在TCP/IP?/span>RFC文档中对包的最大尺寔R有严格限制规定,许多操作pȝ?/span>TCP/IP协议栈都规定ICMP 包大ؓ64KBQ且在对包的标题头进行读取之后,要根据该标题头里包含的信息来为有效蝲L成缓冲区?/span>"Ping of Death" 是故意产生畸Ş的测?/span>PingQ?/span>Packet Internet GroperQ包Q声U自q寸过 ICMP 上限Q也是加蝲的尺寸超q?/span> 64KB上限Q未采取保护措施的|络pȝ出现内存分配错误Q导?/span> TCP/IP 协议栈崩溃,最l接收方荡机?/span>
Land Q?/span>Land AttackQ攻击:?/span> Land d中,黑客利用一个特别打造的SYN ?/span>--它的原地址和目标地址都被讄成某一个服务器地址q行d。此丑ְD接受服务器向它自q地址发?/span> SYN-ACK 消息Q结果这个地址又发?/span> ACK 消息q创Z个空q接Q每一个这Lq接都将保留直到时Q在 Land d下,许多 UNIX崩溃,NT 变得极其~慢Q大U持l五分钟Q?/span> IPƺ骗DOSdQ这U攻d?/span>TCP协议栈的RST位来实现Q?/span>IPƺ骗Q迫使服务器把合法用Lq接复位Q媄响合法用Lq接。假讄在有一个合法用?/span>(100.100.100.100)已经同服务器建立了正常的q接Q攻击者构造攻ȝTCP数据Q伪装自qIP?/span>100.100.100.100Qƈ向服务器发送一个带?/span>RST位的TCP数据Dc服务器接收到这L数据后,认ؓ?/span>100.100.100.100发送的q接有错误,׃清空~冲Z已徏立好的连接。这Ӟ合法用户100.100.100.100再发送合法数据,服务器就已经没有q样的连接了Q该用户p拒绝服务而只能重新开始徏立新的连接?/span>
常见?/span>DDoSd
smurf?/span>Fraggle d?/span>Trinoo?/span>Tribe Flood Network(TFN)?/span>TFN2k以及Stacheldraht是比较常见的DDoSdE序Q我们再看看它们的原理,其攻L\基本相近?/span> Smurf dQ?/span>Smurf是一U简单但有效?/span> DDoS d技术,Smurfq是利用pingE序q行?/span>IP假冒的直接广播进行攻凅R在Internet上广播信息可以通过一定的手段Q通过q播地址或其他机Ӟ发送到整个|络中的机器。当某台机器使用q播地址发送一?/span>ICMP echoh包时Q例?/span>PingQ,一些系l会回应一?/span>ICMP echo回应包,q样发送一个包会收到许多的响应包?/span>Smurfd是使用q个原理来进行的Q同时它q需要一个假冒的源地址。也是?/span>Smurf在网l中发送的源地址d的主机地址Q目的地址为广播地址?/span>ICMP echoh包,使许多的pȝ同时响应q发送大量的信息l被dLQ因Z的地址被攻击者假冒了Q?/span>Smurf是用一个伪造的源地址q箋ping一个或多个计算机网l,q就D所有计机响应的那个主机地址q不是实际发送这个信息包的攻击计机。这个伪造的源地址Q实际上是d的目标,它将被极大数量的响应信息量所Ҏ。对q个伪造信息包做出响应的计机|络成为攻ȝ不知情的同谋。一个简单的 smurf d最l导致网l阻塞和W三方崩溃,q种d方式要比 ping of death z水的流量高Z两个数量U。这U用网l发送一个包而引出大量回应的方式也被叫做Smurf"攑֤"?/span>
]]>Gatewayhttp://www.tkk7.com/czihong/articles/378896.htmlChan ChenChan ChenWed, 23 May 2012 00:43:00 GMThttp://www.tkk7.com/czihong/articles/378896.htmlhttp://www.tkk7.com/czihong/comments/378896.htmlhttp://www.tkk7.com/czihong/articles/378896.html#Feedback0http://www.tkk7.com/czihong/comments/commentRss/378896.htmlhttp://www.tkk7.com/czihong/services/trackbacks/378896.html
In computer networking, a gateway is a node (a router) on a TCP/IP network that serves as an access point to another network. A default gateway is the node on the computer network that the network software uses when an IP address does not match any other routes in the routing table.
In home computing configurations, an ISP often provides a physical device which both connects local hardware to the Internet and serves as a gateway. Such devices include DSL modems and cable modems.
In organizational systems a gateway is a node that routes the traffic from a workstation to another network segment. The default gateway commonly connects the internal networks and the outside network (Internet). In such a situation, the gateway node could also act as a proxy server and a firewall. The gateway is also associated with both a router, which uses headers and forwarding tables to determine where packets are sent, and a switch, which provides the actual path for the packet in and out of the gateway.
In other words, a default gateway provides an entry point and an exit point in a network.
Contents
[hide]
1 Example1
2 Example2
3 See also
4 External links
[edit]Example1
An office network consists of six hosts and a router is given as:
Hosts addresses:
192.168.4.3
192.168.4.4
192.168.4.5
192.168.4.6
192.168.4.7
192.168.4.8
Router (this side) address:
192.168.4.1
The network has a subnet mask of:
255.255.255.0 (/24 in CIDR notation)
Thus the usable network ranges from addresses 192.168.4.1 to 192.168.4.254. (TCP/IP defines the addresses 192.168.4.0 and 192.168.4.255 for special functions.)
The office's hosts will send packets addressed to IPs within this range directly, by resolving the destination IP address into a MAC address through an ARP sequence (if not already known through the host's ARP cache) and then enveloping the IP packet into a layer 2 (MAC) packet addressed to the destination host.
Packets addressed outside of this range (for this example, a packet addressed to 192.168.12.3) cannot travel directly to the destination. Instead they must be sent to the default gateway for further routing to their ultimate destination. In this example, the default gateway uses the IP address 192.168.4.1, which is resolved into a MAC address with ARP in the usual way. Note that the destination IP address remains 192.168.12.3, but the next-hop physical address is that of the gateway, rather than of the ultimate destination.
[edit]Example2
A network with three routers and three hosts, connected to the Internet through router1.
Hosts and addresses:
PC1 10.1.1.100, default gateway 10.1.1.1
PC2 172.16.1.100, default gateway 172.16.1.1
PC3 192.168.1.100, default gateway 192.168.1.96
Router1:
Interface 1 5.5.5.2 (public IP)
Interface 2 10.1.1.1
Router2:
Interface 1 10.1.1.2
Interface 2 172.16.1.1
Router3:
Interface 1 10.1.1.3
Interface 2 192.168.1.96
Network mask in all networks: 255.255.255.0 (/24 in CIDR notation).
If the routers do not use a Routing Information Protocol to discover which network each router is connected to, then the routing table of each router must be set up.
Router1
Network IDNetwork maskGatewayInterface (examples; may vary)Cost (decreases the TTL)
0.0.0.0 (default route)0.0.0.0Assigned by ISP (e.g. 5.5.5.1)eth0 (Ethernet 1st adapter)10
Router2 manages its attached networks and default gateway; router 3 does the same; router 1 manages all routes within the internal networks.
Accessing internal resources If PC2 (172.16.1.100) needs to access PC3 (192.168.1.100), since PC2 has no route to 192.168.1.100 it will send packets for PC3 to its default gateway (router2). Router2 also has no route to PC3, and it will forward the packets to its default gateway (router1). Router1 has a route for this network (192.168.1.0/24) so router1 will forward the packets to router3, which will deliver the packets to PC3; reply packets will follow the same route to PC2.
Accessing external resources If any of the computers try to access a webpage on the Internet, like http://en.wikipedia.org/, the destination will first be resolved to an IP address by using DNS-resolving. The IP-address could be 91.198.174.2. In this example, none of the internal routers know the route to that host, so they will forward the packet through router1's gateway or default route. Every router on the packet's way to the destination will check whether the packet's destination IP-address matches any known network routes. If a router finds a match, it will forward the packet through that route; if not, it will send the packet to its own default gateway. Each router encountered on the way will store the packet ID and where it came from so that it can pass the request back to previous sender. The packet contains source and destination, not all router hops. At last the packet will arrive back to router1, which will check for matching packet ID and route it accordingly through router2 or router3 or directly to PC1 (which was connected in the same network segment as router1).
The packet doesn't return If router1 routing table does not have any route to 192.168.1.0/24, and PC3 tries to access a resource outside its own network, then the outgoing routing will work until the reply is fed back to router1. Since the route is unknown to router1, it will go to router1's default gateway, and never reach router3. In the logs of the resource they will trace the request, but the requestor will never get any information. The packet will die because the TTL-value decrease to less than 1 when it is travelling through the routers or the router will see that it has a private IP and discard it. This could be discovered by using Microsoft Windows utility Pathping, since you only can ping until that router which has no route or wrong route. (Note that some routers will not reply to pinging.)
]]>DHCP Overviewhttp://www.tkk7.com/czihong/articles/377752.htmlChan ChenChan ChenWed, 09 May 2012 18:09:00 GMThttp://www.tkk7.com/czihong/articles/377752.htmlhttp://www.tkk7.com/czihong/comments/377752.htmlhttp://www.tkk7.com/czihong/articles/377752.html#Feedback0http://www.tkk7.com/czihong/comments/commentRss/377752.htmlhttp://www.tkk7.com/czihong/services/trackbacks/377752.htmlTechnical overview
Dynamic Host Configuration Protocol automates network-parameter assignment to network devices from one or more DHCP servers. Even in small networks, DHCP is useful because it makes it easy to add new machines to the network.
When a DHCP-configured client (a computer or any other network-aware device) connects to a network, the DHCP client sends a broadcast query requesting necessary information from a DHCP server. The DHCP server manages a pool of IP addresses and information about client configuration parameters such as default gateway, domain name, the name servers, other servers such as time servers, and so forth. On receiving a valid request, the server assigns the computer an IP address, a lease (length of time the allocation is valid), and other IP configuration parameters, such as the subnet mask and the default gateway. The query is typically initiated immediately after booting, and must complete before the client can initiate IP-based communication with other hosts. Upon disconnecting, the IP address is returned to the pool for use by another computer. This way, many other computers can use the same IP address within minutes of each other.
Depending on implementation, the DHCP server may have three methods of allocating IP-addresses:
dynamic allocation: A network administrator assigns a range of IP addresses to DHCP, and each client computer on the LAN is configured to request an IP address from the DHCP server during network initialization. The request-and-grant process uses a lease concept with a controllable time period, allowing the DHCP server to reclaim (and then reallocate) IP addresses that are not renewed.
automatic allocation: The DHCP server permanently assigns a free IP address to a requesting client from the range defined by the administrator. This is like dynamic allocation, but the DHCP server keeps a table of past IP address assignments, so that it can preferentially assign to a client the same IP address that the client previously had.
static allocation: The DHCP server allocates an IP address based on a table with MAC address/IP address pairs, which are manually filled in (perhaps by a network administrator). [Only requesting clients with a MAC address listed in this table will be allocated an IP address]. This feature (which is not supported by all DHCP servers) is variously called Static DHCP Assignment (by DD-WRT), fixed-address (by the dhcpd documentation), Address Reservation (by Netgear), DHCP reservation or Static DHCP (byCisco/Linksys), and IP reservation or MAC/IP binding (by various other router manufacturers).
[edit]Technical details
DHCP uses the same two ports assigned by IANA for BOOTP: destination UDP port 67 for sending data to the server, and UDP port 68 for data to the client. DHCP communications are connectionless in nature.
DHCP operations fall into four basic phases: IP discovery, IP lease offer, IP request, and IP lease acknowledgement. These points are often abbreviated as DORA (Discovery, Offer, Request, Acknowledgement).
DHCP clients and servers on the same subnet communicate via UDP broadcasts, initially. If the client and server are on different subnets, a DHCP Helper or DHCP Relay Agentmay be used. Clients requesting renewal of an existing lease may communicate directly via UDP unicast, since the client already has an established IP address at that point.
[edit]DHCP discovery
The client broadcasts messages on the physical subnet to discover available DHCP servers. Network administrators can configure a local router to forward DHCP packets to a DHCP server from a different subnet. This client-implementation creates a User Datagram Protocol (UDP) packet with the broadcast destination of 255.255.255.255 or the specific subnet broadcast address.
A DHCP client can also request its last-known IP address (in the example below, 192.168.1.100). If the client remains connected to a network for which this IP is valid, the server may grant the request. Otherwise, it depends whether the server is set up as authoritative or not. An authoritative server will deny the request, making the client ask for a new IP address immediately. A non-authoritative server simply ignores the request, leading to an implementation-dependent timeout for the client to give up on the request and ask for a new IP address.
DHCPDISCOVER
UDP Src=0.0.0.0 sPort=68
Dest=255.255.255.255 dPort=67
OPHTYPEHLENHOPS
0x010x010x060x00
XID
0x3903F326
SECSFLAGS
0x00000x0000
CIADDR (Client IP Address)
0x00000000
YIADDR (Your IP Address)
0x00000000
SIADDR (Server IP Address)
0x00000000
GIADDR (Gateway IP Address)
0x00000000
CHADDR (Client Hardware Address)
0x00053C04
0x8D590000
0x00000000
0x00000000
192 octets of 0s, or overflow space for additional options. BOOTP legacy
Magic Cookie
0x63825363
DHCP Options
DHCP option 53: DHCP Discover
DHCP option 50: 192.168.1.100 requested
DHCP option 55: Parameter Request List:
Request Subnet Mask (1), Router (3), Domain Name (15),
Domain Name Server (6)
[edit]DHCP offer
When a DHCP server receives an IP lease request from a client, it reserves an IP address for the client and extends an IP lease offer by sending a DHCPOFFER message to the client. This message contains the client's MAC address, the IP address that the server is offering, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer.
The server determines the configuration based on the client's hardware address as specified in the CHADDR (Client Hardware Address) field. Here the server, 192.168.1.1, specifies the IP address in the YIADDR (Your IP Address) field.
DHCPOFFER
UDP Src=192.168.1.1 sPort=67
Dest=255.255.255.255 dPort=68
OPHTYPEHLENHOPS
0x020x010x060x00
0x00000000
YIADDR (Your IP Address)
0xC0A80164
SIADDR (Server IP Address)
0xC0A80101
GIADDR (Gateway IP Address)
0x00000000
CHADDR (Client Hardware Address)
0x00053C04
0x8D590000
0x00000000
0x00000000
192 octets of 0s. BOOTP legacy
Magic Cookie
0x63825363
DHCP Options
DHCP option 53: DHCP Offer
DHCP option 1: 255.255.255.0 subnet mask
DHCP option 3: 192.168.1.1 router
DHCP option 51: 86400s (1 day) IP lease time
DHCP option 54: 192.168.1.1 DHCP server
DHCP option 6: DNS servers 9.7.10.15, 9.7.10.16, 9.7.10.18
[edit]DHCP request
In response to the offer Client requests the server. The client replies DHCPRequest, unicast to the server, requesting the offered address. A client can receive DHCP offers from multiple servers, but it will accept only one DHCP offer. Based on the Transaction ID field in the request, servers are informed whose offer the client has accepted. When other DHCP servers receive this message, they withdraw any offers that they might have made to the client and return the offered address to the pool of available addresses. In some cases DHCP request message is broadcast, instead of being unicast to a particular DHCP server, because the DHCP client has still not received an IP address. Also, this way one message can let all other DHCP servers know that another server will be supplying the IP address without missing any of the servers with a series of unicast messages.
When the DHCP server receives the DHCPREQUEST message from the client, the configuration process enters its final phase. The acknowledgement phase involves sending a DHCPACK packet to the client. This packet includes the lease duration and any other configuration information that the client might have requested. At this point, the IP configuration process is completed.
The protocol expects the DHCP client to configure its network interface with the negotiated parameters.
DHCPACK
UDP Src=192.168.1.1 sPort=67
Dest=255.255.255.255 dPort=68
OPHTYPEHLENHOPS
0x020x010x060x00
XID
0x3903F326
SECSFLAGS
0x00000x0000
CIADDR (Client IP Address)
0x00000000
YIADDR (Your IP Address)
0xC0A80164
SIADDR (Server IP Address)
0xC0A80101
GIADDR (Gateway IP Address switched by relay)
0x00000000
CHADDR (Client Hardware Address)
0x00053C04
0x8D590000
0x00000000
0x00000000
192 octets of 0s. BOOTP legacy
Magic Cookie
0x63825363
DHCP Options
DHCP option 53: DHCP ACK
DHCP option 1: 255.255.255.0 subnet mask
DHCP option 3: 192.168.1.1 router
DHCP option 51: 86400s (1 day) IP lease time
DHCP option 54: 192.168.1.1 DHCP server
DHCP option 6: DNS servers 9.7.10.15, 9.7.10.16, 9.7.10.18
After the client obtains an IP address, the client may use the Address Resolution Protocol (ARP) to prevent IP conflicts caused by overlapping address pools of DHCP servers.
[edit]DHCP information
A DHCP client may request more information than the server sent with the original DHCPOFFER. The client may also request repeat data for a particular application. For example, browsers use DHCP Inform to obtain web proxy settings via WPAD. Such queries do not cause the DHCP server to refresh the IP expiry time in its database.
[edit]DHCP releasing
The client sends a request to the DHCP server to release the DHCP information and the client deactivates its IP address. As client devices usually do not know when users may unplug them from the network, the protocol does not mandate the sending of DHCP Release.
[edit]Client configuration parameters in DHCP
A DHCP server can provide optional configuration parameters to the client. RFC 2132 describes the available DHCP options defined by Internet Assigned Numbers Authority(IANA) - DHCP and BOOTP PARAMETERS.
A DHCP client can select, manipulate and overwrite parameters provided by a DHCP server.[3]
[edit]Options
An option exists to identify the vendor and functionality of a DHCP client. The information is a variable-length string of characters or octets which has a meaning specified by the vendor of the DHCP client. One method that a DHCP client can utilize to communicate to the server that it is using a certain type of hardware or firmware is to set a value in its DHCP requests called the Vendor Class Identifier (VCI) (Option 60). This method allows a DHCP server to differentiate between the two kinds of client machines and process the requests from the two types of modems appropriately. Some types of set-top boxes also set the VCI (Option 60) to inform the DHCP server about the hardware type and functionality of the device. The value that this option is set to give the DHCP server a hint about any required extra information that this client needs in a DHCP response.
[edit]DHCP Relaying
In small networks, where only one IP subnet is being managed, DHCP clients communicate directly with DHCP servers. However, DHCP servers can also provide IP addresses for multiple subnets. In this case, a DHCP client that has not yet acquired an IP address cannot communicate directly with the DHCP server using IP routing, because it doesn't have a routable IP address, nor does it know the IP address of a router. In order to allow DHCP clients on subnets not directly served by DHCP servers to communicate with DHCP servers, DHCP relay agents can be installed on these subnets. The DHCP client broadcasts on the local link; the relay agent receives the broadcast and transmits it to one or more DHCP servers using unicast. The relay agent stores its own IP address in the GIADDR field of the DHCP packet. The DHCP server uses the GIADDR to determine the subnet on which the relay agent received the broadcast, and allocates an IP address on that subnet. When the DHCP server replies to the client, it sends the reply to the GIADDR address, again using unicast. The relay agent then retransmits the response on the local network.
[edit]Reliability
The DHCP protocol provides reliability in several ways: periodic renewal, rebinding, and failover. DHCP clients are allocated leases that last for some period of time. Clients begin to attempt to renew their leases once half the lease interval has expired. They do this by sending a unicast DHCPREQUEST message to the DHCP server that granted the original lease. If that server is down or unreachable, it will fail to respond to the DHCPREQUEST. However, the DHCPREQUEST will be repeated by the client from time to time,[specify] so when the DHCP server comes back up or becomes reachable again, the DHCP client will succeed in contacting it, and renew its lease.
If the DHCP server is unreachable for an extended period of time,[specify] the DHCP client will attempt to rebind, by broadcasting its DHCPREQUEST rather than unicasting it. Because it is broadcast, the DHCPREQUEST message will reach all available DHCP servers. If some other DHCP server is able to renew the lease, it will do so at this time.
In order for rebinding to work, when the client successfully contacts a backup DHCP server, that server must have accurate information about the client's binding. Maintaining accurate binding information between two servers is a complicated problem; if both servers are able to update the same lease database, there must be a mechanism to avoid conflicts between updates on the independent servers. A standard for implementing fault-tolerant DHCP servers was developed at the Internet Engineering Task Force.[4][note 1]
If rebinding fails, the lease will eventually expire. When the lease expires, the client must stop using the IP address granted to it in its lease. At that time, it will restart the DHCP process from the beginning by broadcasting a DHCPDISCOVER message. Since its lease has expired, it will accept any IP address offered to it. Once it has a new IP address, presumably from a different DHCP server, it will once again be able to use the network. However, since its IP address has changed, any ongoing connections will be broken.
[edit]Security
The base DHCP protocol does not include any mechanism for authentication.[5] Because of this, it is vulnerable to a variety of attacks. These attacks fall into three main categories:
Unauthorized DHCP servers providing false information to clients.[6]
Unauthorized clients gaining access to resources.[6]
Resource exhaustion attacks from malicious DHCP clients.[6]
Because the client has no way to validate the identity of a DHCP server, unauthorized DHCP servers can be operated on networks, providing incorrect information to DHCP clients. This can serve either as a denial-of-service attack, preventing the client from gaining access to network connectivity[citation needed], or as a man-in-the-middle attack. Because the DHCP server provides the DHCP client with server IP addresses, such as the IP address of one or more DNS servers,[6] an attacker can convince a DHCP client to do its DNS lookups through its own DNS server, and can therefore provide its own answers to DNS queries from the client.[7] This in turn allows the attacker to redirect network traffic through itself, allowing it to eavesdrop on connections between the client and network servers it contacts, or to simply replace those network servers with its own.[7]
Because the DHCP server has no secure mechanism for authenticating the client, clients can gain unauthorized access to IP addresses by presenting credentials, such as client identifiers, that belong to other DHCP clients.[citation needed] This also allows DHCP clients to exhaust the DHCP server's store of IP addresses—by presenting new credentials each time it asks for an address, the client can consume all the available IP addresses on a particular network link, preventing other DHCP clients from getting service.[citation needed]
DHCP does provide some mechanisms for mitigating these problems. The Relay Agent Information Option protocol extension (RFC 3046) allows network operators to attach tags to DHCP messages as these messages arrive on the network operator's trusted network. This tag is then used as an authorization token to control the client's access to network resources. Because the client has no access to the network upstream of the relay agent, the lack of authentication does not prevent the DHCP server operator from relying on the authorization token.[5]
Another extension, Authentication for DHCP Messages (RFC 3118), provides a mechanism for authenticating DHCP messages. Unfortunately RFC 3118 has not seen widespread adoption because of the problems of managing keys for large numbers of DHCP clients.[8]
]]>Bits and Byteshttp://www.tkk7.com/czihong/articles/372255.htmlChan ChenChan ChenTue, 20 Mar 2012 03:01:00 GMThttp://www.tkk7.com/czihong/articles/372255.htmlhttp://www.tkk7.com/czihong/comments/372255.htmlhttp://www.tkk7.com/czihong/articles/372255.html#Feedback0http://www.tkk7.com/czihong/comments/commentRss/372255.htmlhttp://www.tkk7.com/czihong/services/trackbacks/372255.html
Question: What Is the Difference Between Bits and Bytes?
The terms bit and byte are common in computer networking. Both terms refer to digital data transmitted over a network connection. For example, bits and bytes both may represent network addresses or port numbers.
Answer:
A bit is a single numeric value, either '1' or '0', that encodes a single unit of digital information. A byte is a sequence of bits; usually eight bits equal one byte.
For example, in Internet Protocol (IP) networking, IP addresses contain 32 bits or 4 bytes. The bits encode the network address so that it can be shared on the network. The bytes divide the bits into groups.
The IP address 192.168.0.1, for instance, is encoded with the following bits and bytes:
11000000 10101000 00000000 00000001
Bits are grouped into bytes to, generally speaking, increase the efficiency of computer hardware, including network equipment, disks and memory.
Q. "Is there any difference between bps (small 'b') and Bps (capital 'b')?"
A. The term "bps" specifies network bandwidth in bits per second. The term "Bps" specifies network bandwidth in bytes per second.
]]>Telnet and SSHhttp://www.tkk7.com/czihong/articles/371752.htmlChan ChenChan ChenMon, 12 Mar 2012 09:29:00 GMThttp://www.tkk7.com/czihong/articles/371752.htmlhttp://www.tkk7.com/czihong/comments/371752.htmlhttp://www.tkk7.com/czihong/articles/371752.html#Feedback0http://www.tkk7.com/czihong/comments/commentRss/371752.htmlhttp://www.tkk7.com/czihong/services/trackbacks/371752.html
Telnet is a protocol that allows you to connect to remote computers (called hosts) over a TCP/IP network (such as the Internet). You use software called a telnet client on your computer to make a connection to a telnet server (i.e., the remote host). Once your telnet client establishes a connection to the remote host, your client becomes a virtual terminal, allowing you to communicate with the remote host from your computer. In most cases, you'll need to log into the remote host, which requires that you have an account on that system. Occasionally, you can log in as guest or public without having an account.
Telnet clients are available for all major operating systems.
Command-line telnet clients are built into most versions of Mac OS X, Windows, Unix, and Linux. To use them, go to their respective command lines (i.e., the Terminal application in Mac OS X, the shell in Unix or Linux, or the DOS prompt in Windows), and then enter:
telnet host
Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server and a client (running SSH server and SSH client programs, respectively).[1] The protocol specification distinguishes two major versions that are referred to as SSH-1 and SSH-2.
The best-known application of the protocol is for access to shell accounts on Unix-like operating systems. It was designed as a replacement for Telnet and other insecure remote shell protocols such as the Berkeley rsh and rexec protocols, which send information, notably passwords, in plaintext, rendering them susceptible to interception and disclosure using packet analysis.[2] The encryption used by SSH is intended to provide confidentiality and integrity of data over an unsecured network, such as the Internet.
]]>How does DNS workhttp://www.tkk7.com/czihong/articles/370335.htmlChan ChenChan ChenMon, 20 Feb 2012 03:47:00 GMThttp://www.tkk7.com/czihong/articles/370335.htmlhttp://www.tkk7.com/czihong/comments/370335.htmlhttp://www.tkk7.com/czihong/articles/370335.html#Feedback0http://www.tkk7.com/czihong/comments/commentRss/370335.htmlhttp://www.tkk7.com/czihong/services/trackbacks/370335.html
Suppose your computer wants to find the IP address ofnetwork-surveys.cr.yp.to. It contacts a series ofDNS serversaround the Internet.
There are several DNS servers with information about network-surveys.cr.yp.to. A central root server (located at Internet HQ in Virginia) has the following data in a file on disk:
.:198.41.0.4 &to:198.6.1.82
The root server's IP address is 198.41.0.4; your computer also has this address in a file on disk. Your computer sends its question to the root server, and receives a response from the root server's data:
Your computer sends its question to that DNS server, and receives a response:
+--------+ network-surveys.cr.yp.to? +---------------+ | Your | ------------------------------------------> |131.193.178.160| |computer| <------------------------------------------ | .yp.to server | +--------+ =network-surveys.cr.yp.to:131.193.178.100 +---------------+
The response=network-surveys.cr.yp.to:131.193.178.100finally answers the original question: the IP address ofnetwork-surveys.cr.yp.tois 131.193.178.100.
All of this work is handled by a DNS cache running on your computer. Your computer remembers everything that it learned (for a limited amount of time; information changes!) to save time later. As an alternative, your computer can contact an external DNS cache operated by your Internet service provider; the external DNS cache will do all the work and report the answer.
Multiple servers
To protect against computer failure, there are actually several root servers, several.toservers, and twoyp.toservers. Each of the root servers has the following information:
Each of the.toservers has the following information:
.to:128.250.1.21:a .to:193.0.0.193:b .to:196.7.0.139:c .to:206.184.59.10:d .to:198.6.1.82:e .to:206.86.247.253:f .to:148.59.19.11:g &yp.to:131.193.178.181:a &yp.to:131.193.178.160:b # or, in BIND master zone-file format: # yp.to IN NS a.ns.yp.to # yp.to IN NS b.ns.yp.to # a.ns.yp.to IN A 131.193.178.181 # b.ns.yp.to IN A 131.193.178.160
Your computer tries the root servers in a random order. When it receives a response from some root server, it moves to the.toservers, and tries them in a random order. It eventually receives the answer from one of the twoyp.toservers.
Reverse lookups
Suppose your computer sees the IP address 208.33.217.122 and wants to know the corresponding computer name.
Your computer asks a series of DNS servers about the name 122.217.33.208.in-addr.arpa. The root servers have the following information:
Looking up the address for a name, and then the computer name for that address, doesn't necessarily produce the original name. Looking up the computer name for an address, and then the address for that name, doesn't necessarily produce the original address.
1. Your web browser asks the resolving DNS server what the address of www.domainname.com is. Your computer already knows where the local ISP resolving DNS server is through its network configuration. 2. The Resolving DNS server does not know the address. So it asks a root server the same question. The 13 root servers have globally well-known IP addresses, and are run by a US-based company called ICANN 3. The root server replies that it does not know, but it gives the address of the server which knows about .com domains. 4. The resolving DNS server asks the .com server what the address of www.domainname.com is. 5. The .com server replies that it does not know, but it gives the address of the server which knows about .domainname.com domain. This server is can be a managed server and many companies pay an annual fee (via a domain registar) to maintain this referral for their domain. 6. The resolving DNS server asks the .domainname.com server what the address of www.domainname.com is. 7. The server answers the query with the IP address of www.domainname.com, and marks the response as “authoratitve”. This is an assertion that the answer is correct and complete. It also adds to its reply that “this data is valid for 24 hours”, so that anyone who is asking can confidently re-use the information for that time without having to issue another query. 8. The resolving DNS server finally has its answer, and can reply back to the web browser with the IP address. Crucially it marks its answer as “non-authoratitive”, so that the web browser knows it has the information indirectly