Linux ARP And Commands

The (ARP)  stands for Address Resolution Protocol. The ARP work is to define the define the network interfaces connected to an ethernet media segment (hardware addresses) to map an IP address (logical addresses assigned to machines) to a link layer address which it do on demand. The link layer address is the correct term although it is interchangeably  used with  Ethernet addresses, Media Access Control (MAC) addresses.


 ARP is commonly used to translate the protocol addresses to hardware interface addresses. Modifying the ARP cache can change which interfaces handles the specific requests. ARP cache entries may be marked with the following flags:
C (complete), M (permanent), and P (publish)

While arp can create a proxy for a single system, subnet proxies can be handled by the arp kernel module.

 arp [-evn] [-H type] [-i if] -a [hostname]
arp [-v] [-i if] -d hostname [pub]
arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]
arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub
arp [-v] [-H type] [-i if] -Ds hostname ifa [netmask nm] pub
arp [-vnD] [-H type] [-i if] -f [filename]

  • -a [hosts] , --display [hosts] It displays the entries for hosts, if none of them are specified, all entries.
  • -d host [pub] , --delete host [pub] Removes the specified host's entry. To delete a proxy entry, add the pub argument and specify the interface associated with the proxy using -i.
  • -D, --use-device Use the hardware address associated with the specified interface. This may be used with -s when creating a proxy entry.
  • -f file, --file file Read the entries from a file and add them.
  • -H type, --hw-type type, -t type Search for type entries when examining the ARP cache. type is usually ether (Ethernet), which is the default, but may be ax25 (AX.25 packet radio), arcnet (ARCnet), pronet (PROnet), or netrom (NET/ROM).
  • -i interface, --device interface Select an interface. If you need to dump the ARP cache, this option will cause the command to display  the entries using that interface. When setting entries, this will cause the interface to be associated with that entry. If you do not use this option when setting an entry, the kernel will guess.
  • -n, --numeric Display host IP addresses instead of their domain names.
  • -s host hardware-address [netmask mask] [pub] , --set host hardware-address [pub] It Adds a permanent entry for host at hardware-address. A hardware-address for type ether hardware is 6 hexadecimal bytes, colon-separated. The pub argument can be used to set the publish flag, creating a proxy entry.
  • -v, --verbose Verbose mode.

    Here are all the possible states for entries in the neighbor table.

    Table 2.1. Active ARP cache entry states
    ARP cache entry statemeaningaction if used
    permanentnever expires; never verifiedreset use counter
    noarpnormal expiration; never verifiedreset use counter
    reachablenormal expirationreset use counter
    stalestill usable; needs verificationreset use counter; change state to delay
    delayschedule ARP request; needs verificationreset use counter
    probesending ARP requestreset use counter
    incompletefirst ARP request sentsend ARP request
    failedno response receivedsend ARP request

 

Understanding ext3 file system and its advantages

The ext2 file system of Linux is a well-tested subsystem and very well optimized. But as of now, the other file systems that were in there experimental stage when ext2 was created have optimized, tested, matured and have become available for Linux.

There are four file systems which one might consider to replace the aging ext2 with: ext3, ReiserFS, XFS, and JFS. All the four of these file systems offers features that might be tempting in various circumstances, but the most important enhancement offered by all the four is called journaling. Considering the Traditional file systems (such as ext2) must search through the directory structure and find the right place on disk to lay out the data, and then lay out the data. (Linux is capable of cache the whole process mentioned above, including the directory updates and thereby making the process  faster to the user.)

The problem with this method  is that in the event of an unexpected crash of Operating system due to some reasons, the fsck program has to go in and follow up on all of the files that are on the disk in order to make sure that they don’t contain any dangling references (for example, i-nodes that point to  other, invalid i-nodes or data blocks). As the disks expands in size and shrink in price, the availability of these large capacity disks means more of us will have to deal with the aftermath of having to fsck a large disk. And  anyone who had done that before can tell you, it isn’t fun. The process can take long time to complete, and that means downtime for your users, which is not exceptable in the organizations .

With journaling file systems, the new way of getting data out to disk, instead of finding the right place, the file system simply writes the data out in any order it can, as fast as it can. Each time, it logs the location of these data blocks.For eg:-  You can think of it as being like using the same spiral notebook for multiple classes without prepartitioning the notebook. It would be wiser to simply take notes for each class in chronological order instead of grouping all of one class together. A journaled file system is like such a notebook, with the beginning of the notebook containing an index telling you which pages contain all the notes for a single class. Once the data is written, the file system can go move things around to make them optimal for reading without risking the integrity of the file.

This means to you as a system administrator is that the amount of time it takes for the disk to write out data is much less, while at the same time the safety of getting the data written out to disk quickly means that in the event of a system crash, you won’t need to run fsck exhaustively under pressure. Even when you do run fsck, it only has to check recently modified data, so instead of interminable times, you’ll find that the checks go very quickly.

So the last question arises, which of the four journaling systems should you choose? That is entirely up to you. But the only one we have discussed is ext3, which is the default file system in Red Hat Linux.

Concept of the i-Nodes and Superblocks in Linux/Unix System

The fundamental building block of  UNIX file systems (including Linux’s ext2/ext3) is the i-node. An i-node is a control structure that points either to the other i-nodes or to data blocks.

The control information in the i-node includes the file’s owner, permissions, size, time of last access, creation time, group ID, etc. ( the entire kernel data structure is available in /usr/src/linux/include/linux/ext3_fs.h—assuming, of course, that you have the source tree installed in the /usr/src directory.) The one thing that an i-node doesn"t  keep is the file’s name.

While the directories themselves are special instances of  the files. And this means that each directory gets an i-node, and further the i-node points to data blocks containing information (filenames and i-nodes) about the files in the directory. The i-nodes are used to provide the  indirection so that more data blocks can be pointed to—which is reason why each i-node does not
contains the filename. (Only one i-node works as a representative for the entire file which contains the filename; thus it would be a waste of the space if every i-node contains the  filename information.) Each indirect block can be used to point in turn to other indirect blocks if necessary.

Superblocks:-
The very first information which is read from a disk is its superblock. This small data structure reveals the several key pieces of the information, which includes the disk’s geometry, the amount of available space, and, most important of the all, the location of the first i-node. In the absence of a superblock, a file system is useless.

Something as important as the superblock cannot be left to the chance. Thus the Multiple copies of this data structure are scattered all over the disk to provide backup in case the one is damaged. Under the Linux’s ext2 file system, a superblock is placed after every group of blocks, which contains an i-nodes and data. One group consists of 8,192 blocks; thus this means the first redundant superblock is at 8193, the second at 16385, and so on.

Remote Shell: rsh

As you might have seen with telnet, that you must enter a username and password in order to log on to another host. This may not work out well for those people who need to remotely log in to other hosts often . They want that the other host  automatically to trust them so that when issued a remote login request, the system would allow them access without asking for a login and password.

The double-win has a feature like that and has the ability to automate tasks that require one host to invoke a program on another host.

To accommodate this in Linux, the rsh command was created. In its simplest form, specify the name of the host you wish to log in to, same as the way you would do for telnet. For example:
[rwhite@workbox rwhite]$ rsh gregory

If you have set up your configuration files so that gregory knows to trust you, the system will automatically give you a shell prompt. If the configuration file does not automatically trust you, you will need to enter your password again.

To set up the configuration file, edit the .rhosts file ( there is a period in front of the filename) in your home directory. Open the .rhosts file and create a line that looks like this:
host_to_trust your_username

And If you want to rsh from workbox to gregory without being prompted for a password, create the following file in an .rhosts file in your home directory on gregory:
workbox rwhite


And thats it you are ready to go!


The rsh enables you to login remotely at shell prompt of other server but than again there is a utility known as ssh(secure shell client). Just have a look at that too and than decide which one you would like to use.

Languages Internal/external to Oracle database and developers suite

The SQL is a language which cannot be avoided in accessing a database but it can”t be used alone by itself to develop the applications as it does not have facilities for developing the user interfaces and lacks the procedural structures needed for manipulating rows individually.

PL/SQL is a proprietary language to Oracle. PL/SQL has the usual procedural constructs (such as conditional branching based on if-then-else and iterative looping) and facilities for user interface design. With the PL/SQL code calls can be embed to SQL. PL/SQL application have the ability to use SQL to retrieve one or more rows from the database, then perform various actions based on their content, and then issue more SQL to write rows back to the database.

The other languages are also available which run external to the database such as C or Java and also many 3GL languages can also be used. For most of the languages oracle provides the OCI (Oracle Call Interface) libraries which let the code written in these languages to connect to the database and invoke the SQL commands. But remember that these libraries are proprietary to the Oracle which means the code would run for oracle database only and would have to be rewritten for it to run on other database but Java applications can avoid this problem. So it is quite clear that many organizations will not want to use the 3GL to develop the applications for database. Due to this Oracle Corporation provides application development tools as part of the Oracle Developer Suite. With these tools the programmers can be far more productive than if they were working with a 3GL.

 

Managing Shell And its Secrets

Subscribe To Get Update On Mobile

Subscribe
Get updates of latest post on your mobile free