Tuesday, November 11, 2014

Summary on TCP/IP

TCP/IP stands for “Transmission Control Protocol / Internet Protocol”. It is basically a network protocol that defines the details of how data is sent and received through network adapters, hubs, switches, routers and other network communications hardware. It was developed by the US department of defense for the purpose of connecting government computer systems to each other through a global, fault tolerant, network. The defense department network was opened up to research institutions and eventually the general public to create what is now the Internet. The TCP/IP protocol was also placed in the public domain so that any software company could develop networking software based on the protocol. Because it is the primary protocol used on the Internet, and it is in the public domain, it has become the most popular networking protocol throughout the world and is therefore well supported by almost all computer systems and networking hardware.
The TCP/IP protocol is designed such that each computer or device in a network has a unique "IP Address" (Internet Protocol Address) and each IP address can open and communicate over up to 65535 different “ports” for sending and receiving data to or from any other network device. The IP Address uniquely identifies the computer or device on the network and a "Port Number" identifies a specific connection between one computer or device and another (i.e between two IP Addresses). A TCP/IP "port" can be thought of as a private two-way communications line where the port number is used to identify a unique connection between two devices. The concept is very similar to any other type of port on your PC (serial, parallel, etc) except that instead of having a physical connection, the TCP/IP protocol creates a "virtual IP port" and the network hardware and software is responsible for routing data in and out of each virtual IP port.
TCP/IP connections work in a manner similar to a telephone call where someone has to initiate the connection by dialing the phone. At the other end of the connection, someone has to be listening for calls and then pick up the line when a call comes in. In TCP/IP communications, the IP Address is analogous to a telephone number and the port number would be analogous to a particular extension once the call has been answered. The “Client” in a TCP/IP connection is the computer or device that “dials the phone” and the “Server” is the computer that is “listening” for calls to come in. In other words, the Client needs to know the IP Address of whatever Server it wants to connect to and it also needs to know the port number that it wants to send and receive data through after a connection has been established. The Server only has to listen for connections and either accept them or reject them when they are initiated by a client.
Once a connection through a TCP/IP port has been established between a TCP/IP client and a TCP/IP server, data can be sent in either direction exactly the same way that data is sent through any other type of port on a PC (serial, parallel, etc.). The only difference is that the data is sent across your network. The connection between a Client and a Server remains open until either the client or the server terminates the connection (i.e. hangs up the phone). One extremely nice benefit of the TCP/IP protocol is that the low level drivers that implement the sending and receiving of data perform error checking on all data so you are guaranteed that there will be no errors in any data that you send or receive.

Security Tools

A. Network Sniffers
Network sniffers or network analyzers are tools, software or hardware, used to sniff data flow through a connection. They work in passive mode and only tap into the connection to listen into the packet exchange without altering or redirecting it. Sniffing tools can be used for analysing network packets to solve problems in network and identify any malicious packets or behavior. Wireshark: Wireshark is an open source sniffer tool used for sniffing and analyzing packets. It captures live packets, and can analyze them in offline mode. These packets can include Ethernet, IEEE 802.11, PPP, and loopback. Wireshark can work on many platforms like Windows, Linux, OS X, Solaris, NetBSD, FreeBSD and others. It provides GUI and command line interfaces. Tcpdump: Tcpdump is free software used for analyzing packets on TCP/IP using a command line interface. This tool works mostly on Linux but also can work on other operating systems like Solaris, BSD, Mac OS X, HP-UX, AIX and Windows through WinDump. Kismet: Kismet is not only a packet analyzer but also a network detector and intrusion detection system (IDS). It can capture packets on wireless network using 802.11a/b/g/n traffic and throughput. 
B. Vulnerabilities scanners
Vulnerability scanner is software used to look for vulnerabilities on a computer network, computer system, or computer applications. These tools are used by attackers to find any vulnerability, which can be exploited to launch attacks. On the other hand security administrators use it to find open vulnerabilities on their systems so that these can be patched and attacks can be prevented. Following are examples of some notable vulnerability scanners. Nessus: Nessus is a network vulnerability scanner. It was open source and free up till 2005. Then it was transformed into a commercial product. Nessus works by analyzing the network to find any hole in the network, which can allow an attacker to launch an attack by exploiting this vulnerability. It is a cross-platform tool and works on Linux, Mac OS X, and Microsoft Windows. It contains a well-designed Graphical User interface , making it a user friendly and easy to learn tool. OpenVAS: Open Vulnerability Assessment System OpenVAS is a framework containin several services and tools forged from Nessus in 2005 when Nessus was launched as a commercial software. 
C. Attack Detection tools
Some tools are used to detect attacks but they can't prevent attacks. This type of tool is called Intrusion Detection System (IDS) and a particular genre of IDS only operate at network layer and are called Network Intrusion Detection System (NIDS). These NIDS use signatures, anomaly detection or both as detection technique for their operation. Some notable IDS are listed below: Firestorm: This Network Intrusion Detection System has a high performance and is full of capabilities to detect various attacks. It can analyze many of protocols to detect any malicious patterns in network traffic by using libpcap for capturing packets. It uses anomaly detection method and fully supports Snort rules. Firestorm is cross-platform and works on Linux 2.x, FreeBSD 4.x, OpenBSD, and Solaris. Prelude: Is a hybrid IDS, which uses Snort rules and is capable of using other IDS rules. It uses several sensors in the network to capture and detect any malicious packet. It can work on Linux, BSD, and other operating systems. Dragon: Dragon is a network and host intrusion detection system, which uses rule based and signature based detection techniques. It is a commercial tool and comes with extensive library. 

Efficiency, Reliability and Other Name Resolution Issues and Features

Efficiency Considerations
The first major concern with name resolution is efficiency. Name resolution uses up system resources, especially with resolution techniques that require requests and replies to be sent. This means we want to minimize the number of times resolution is performed, if at all possible. Now, consider that many people will frequently access the same machines over and over again. For example, if you go to a Web site called “www.thisisasite.com” for the first time, your system will need to resolve that name. After the home page for that site loads, if you click a link to another page on that site, the page will also be found at that same name: “www.thisisasite.com”. It would be wasteful to then have to resolve the name a second time.
To avoid this, name systems almost always include some sort of caching capability, which allows devices to remember recent name resolutions and retain the mapping from name to address for a period of time. Whenever a name needs to be resolved, the cache is first checked before going through the formal process of resolution. The use of caching eliminates the vast majority of actual name resolution requests that would otherwise be required.
The drawback of caching is that it requires some system resources of its own, and that it adds complexity to the system. One issue is deciding how long to retain data in the cache; if we keep it too short a time, we generate extra unnecessary resolution requests; keep it too long, and we risk having the mapping become “stale” if the name assignment for the machine changes. These are issues that a sophisticated name system must deal with. A typical solution is to allow each name registration to specify how long information about that name-to-address link may be cached.
Reliability Considerations
The main concern with name resolution after efficiency is reliability. As I said earlier in the section, having a name system isn't strictly necessary for the computers, but it's very important for the users, especially on a large network like the Internet. While having a single central place that maintains all information about a name system may make administration simpler, it creates a dangerous “single point of failure”. If anything happens to the device storing the information, the entire name system fails.
Modern name systems employ redundancies to prevent having the entire system rely on any particular device for resolution. A typical approach in a client/server system is to have multiple servers in different locations (or attached to different networks) that can respond to name resolution requests.


TCP/IP In Terms Of Speed, Bandwidth, Throughput and Latency

Speed
This is the most generic performance term used in networking. As such, it can mean just about anything. Most commonly, however, it refers to the rated or nominal speed of a particular networking technology. For example, Fast Ethernet has a nominal speed of 100 megabits per second; it is for that reason often called 100 Mbit Ethernet, or given a designation such as “100BASE-TX”.
Rated speed is the biggest “performance magic number” in networking—you see it used to label hardware devices, and many people bandy the numbers about as if they actually were the real “speed of the network”. The problem with using nominal speed ratings is that they are theoretical only, and as such, tell an incomplete story. No networking technology can run at its full rated speed, and many run substantially below it, due to real-world performance factors.
Speed ratings such as “100 Mbps Ethernet” are also often referred to as the “throughput” of a technology, even though the maximum theoretical speed of a technology is more analogous to bandwidth than throughput, and the two are not identical. More on this in the next two bullet points.
Bandwidth
Bandwidth is a widely-used term that usually refers to the data-carrying capacity of a network or data transmission medium. It indicates the maximum amount of data that can pass from one point to another in a unit of time. The term comes from the study of electromagnetic radiation, where it refers to the width of a band of frequencies used to carry data. It is usually given in a theoretical context, though not always.
Bandwidth is still used in these two senses: “frequency band width” and data capacity. For example, radio frequencies are used for wireless technologies, and the bandwidth of such technologies can refer to how wide the RF band is. More commonly, though, it refers to how much data can be sent down a network, and is often used in relative terms. For example, for Internet access, a cable or xDSL is considered “high bandwidth” access; using a regular analog modem is “low bandwidth”.
Throughput
Throughput is a measure of how much actual data can be sent per unit of time across a network, channel or interface. While throughput can be a theoretical term like bandwidth, it is more often used in a practical sense, for example, to measure the amount of data actually sent across a network in the “real world”. Throughput is limited by bandwidth, or by rated speed: if an Ethernet network is rated at 100 megabits per second, that's the absolute upper limit on throughput, even though you will normally get quite a bit less. So, you may see someone say that they are using 100 Mbps Ethernet but getting throughput of say, 71.9 Mbps on their network.
The terms bandwidth and throughput are often used interchangeably, even though they are really not exactly the same, as I just discussed.
Latency
This very important, often overlooked term, refers to the timing of data transfers on a communications channel or network. One important aspect of latency is how long it takes from the time a request for data is made until it starts to arrive. Another aspect is how much control a device has over the timing of the data that is sent, and whether the network can be arranged to allow for the consistent delivery of data over a period of time. Low latency is considered better than high latency.
Applying Performance Measurement Terms
As with all networking terms, there are no hard and fast rules; many people are rather loose with their use of the terms above. You will even see terms such as “throughput bandwidth”, “bandwidth throughput” and other charming inventions from the department of redundancy department. J More often, you will just see a lot of mish-mashed term usage, and especially, spurious conclusions being drawn about what data streams a network can handle based on its rated speed. Making matters worse is that speed ratings are usually specified in bits per second, but throughput may be given in bits or bytes per second.
In general, “speed”, bandwidth and throughput get a lot of attention, while latency gets little. Yet latency considerations are very important for many real-time applications such as streaming audio and video and interactive gaming. In fact, they are often more important than raw bandwidth.
For example, suppose you move to a rural home and your choices for Internet access are a regular 28.8 kbps modem connection or fancy satellite Internet. The companies selling satellite connectivity call it “broadband” and advertise very high rated speeds—400 kbps or more. They make a big deal about it being “over 10 times as fast as dialup” and they certainly charge a lot for this very high-tech service. This is a slam dunk, right?
Wrong. The satellite connection has high bandwidth, but very poor (high) latency due to the time it takes for the signals to travel to and from the satellite. It is definitely much better than the modem for downloading that nice little 150 MB patch from Microsoft. However, it is much worse than the modem for playing the latest online video game with your buddy over the Internet, because of the latency, or lag, in transmissions. Every move you make in your game will be delayed for over half a second as the signal bounces around between the satellite and the earth, making online gaming nearly impossible. Thus, whether satellite Internet is worth the extra money depends entirely on what you plan to use it for.