For example, take the server with the operating system Ubuntu Server 14.04, in which let’s say we changed the network settings when executing the commands:Continue reading “Why service networking restart or /etc/init.d/networking restart does not work”
In this article I will briefly describe the difference between MASQUERADE and SNAT.
MASQUERADE. Less fast routing than SNAT with mass requests, since for each new connection an IP address on the external network interface (WAN) is determined. Great for home use routers and when changing the IP address on the WAN interface.
Continue reading “Difference between MASQUERADE and SNAT”
In this article I’ll look at the SMART information of the first SSD drive that comes under the arm and describe what the attributes mean.
Suppose we looked at the information on the disk /dev/sda:
sudo smartctl -a /dev/sda
I have the following information:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0 2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0 3 Spin_Up_Time 0x0007 100 100 050 Pre-fail Always - 0 5 Reallocated_Sector_Ct 0x0013 100 100 050 Pre-fail Always - 0 7 Unknown_SSD_Attribute 0x000b 100 100 050 Pre-fail Always - 0 8 Unknown_SSD_Attribute 0x0005 100 100 050 Pre-fail Offline - 0 9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 2850 12 Power_Cycle_Count 0x0012 100 100 000 Old_age Always - 10 168 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 0 170 Unknown_Attribute 0x0003 100 100 010 Pre-fail Always - 531 173 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 12255496 175 Program_Fail_Count_Chip 0x0013 100 100 050 Pre-fail Always - 0 187 Reported_Uncorrect 0x0012 100 100 000 Old_age Always - 0 192 Power-Off_Retract_Count 0x0012 100 100 000 Old_age Always - 5 194 Temperature_Celsius 0x0023 071 067 030 Pre-fail Always - 29 (Min/Max 23/33) 196 Reallocated_Event_Count 0x0002 100 100 010 Old_age Always - 0 197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0 199 UDMA_CRC_Error_Count 0x000b 100 100 050 Pre-fail Always - 0 218 Unknown_Attribute 0x000b 100 100 050 Pre-fail Always - 0 231 Temperature_Celsius 0x0013 100 100 000 Pre-fail Always - 94 233 Media_Wearout_Indicator 0x000b 100 100 000 Pre-fail Always - 50171 240 Unknown_SSD_Attribute 0x0013 100 100 000 Pre-fail Always - 0 241 Total_LBAs_Written 0x0012 100 100 000 Old_age Always - 12213 242 Total_LBAs_Read 0x0012 100 100 000 Old_age Always - 321 244 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 187 245 Unknown_Attribute 0x0002 100 100 000 Old_age Always - 264 246 Unknown_Attribute 0x0012 100 100 000 Old_age Always - 12905344
Raw_Read_Error_Rate – means the number of read errors.
Throughput_Performance – overall disk performance.
Spin_Up_Time – time to drive up to the operating speed.
Reallocated_Sector_Ct – number of redistributed (damaged) sectors.
Power_On_Hours – the number of hours that the disk was working.
Power_Cycle_Count – number of disk on/off.
Program_Fail_Count_Chip – number of write errors in flash memory.
Reported_Uncorrect – hardware ECC errors that can not be fixed.
Power-Off_Retract_Count – number of emergency shutdowns.
Temperature_Celsius – the temperature of the disc in degrees Celsius.
Media_Wearout_Indicator – the health indicator of the disc, if it is below 10, then the disc should definitely be replaced.
Total_LBAs_Written – LBA records.
Total_LBAs_Read – LBA reads.
There may also be other attributes:
Start_Stop_Count – number of starts/stops of the spindle.
Seek_Error_Rate – number of positioning errors.
Spin_Retry_Count – number of retry attempts.
Reallocated_Event_Count – number of sector redistribution operations.
Offline_Uncorrectable – number of faulty sectors.
Flying height – height between the head and the surface of the disc.
Disk Shift – the distance of the disc block displacement from the spindle, can change for example after the falls.
G-Sense Error Rate – errors due to external loads/drops.
RAID arrays are necessary to improve the reliability of data storage and increase the speed of working with disks by combining multiple disks into one large one. RAID arrays can be either hardware, firmware or software.
I will describe several types:
RAID 0 (stripe) – The mode is only for improving performance when reading/writing does not increase reliability. The user has access to the whole volume of disks, if one of the disks fails, the array is usually destroyed and data recovery is almost impossible.
RAID 1 (mirror) – On all disks the recording is performed synchronously, they completely duplicate each other. Half of the disk space is available to the user. Increases performance only when reading, but this is a very reliable way to protect information. The minimum number of disks is 2.
RAID 10 (RAID 1+0) – This is an array of RAID0 from RAID1 arrays. Fast as RAID0 and reliable as RAID1. The minimum number of disks is four and their number should be even. Half of the disk space is available to the user.
RAID 0 + 1 – RAID1 array from RAID0 arrays. Not popular, since the advantages are worse than RAID 10.
RAID 1E – Similar to RAID10 using an odd number of disks and a minimum of 3.
RAID 5 – User-accessible space is reduced by one disk, reliability is lower than RAID 1, performance is increased when reading and writing as in RAID 0. If one of the disks fails, the data can be restored. The minimum number of disks is 3.
RAID 6 – Similar to RAID 5, including speed, but a little more reliable. The space available to the user is reduced by two disks, the information is not lost when two disks fail. The minimum number of disks is 4.
I personally prefer to use RAID 1 and RAID 6.
FTP can work both in the active mode and in the passive mode.
In active mode, the client performs a control connection with the server, and the server makes a connection to the client for data transfer.
The passive control connection and data connection are made by the client himself.
Under the control connection is meant authentication and command transmission.
The control connection is executed by the client in both cases equally, from the client side from the dynamic TCP port 1024-65535 to the server port 21.
In the active mode after the control connection from the client, the FTP server connects to the client’s dynamic port 1024-65535 from its TCP port 20 for data transfer.
In the passive mode after the control connection from the client, the FTP server tells the client the number of the dynamic TCP port 1024-65535 to which it can be connected to the client for data transmission.
DHCP – Dynamic Host Configuration Protocol in a TCP / IP network.
I will describe the possible types of DHCP messages:
DHCPDISCOVER — customer request for addresses.
DHCPOFFER — the server’s offer to get the address.
DHCPREQUEST — a client request for an address (suggested by the server in DHCPOFFER).
DHCPACK — server confirmation of the issuance of the address.
DHCPDECLINE — the client’s refusal to receive the proposed address (for example, when the network is already using someone the proposed IP).
DHCPNAK — failure of the server to issue the requested address.
DHCPRELEASE — notification of the client about the release of the address.
DHCPINFORM — customer request for additional parameters.
I will describe the process of successfully obtaining a DHCP client IP address from a DHCP server:
1) DHCP client from IP address 0.0.0.0 through UDP port 67 sends to network IP address 255.255.255.255 broadcast message DHCPDISCOVER “I want to get IP address”.
2) A DHCP server or several DHCP servers, if there are several of them, receive this message and reply to the client from their IP via UDP port 68 with the message DHCPOFFER “I propose an IP address”. The message is sent to the broadcast address 255.255.255.255 or the gateway address if the client is on another network.
3) The DHCP client receives this message or several messages and responds from the IP address 0.0.0.0 to only one DHCP server with the DHCPREQUEST message “Yes, I want this IP address”.
4) The DHCP server sends a DHCPACK message “I assign you this IP address” in response.
Since the IP address has a lease time after which it is released and the DHCP server can issue it for example to another client, the DHCP clients usually request the renewal with a DHCPREQUEST message and receive a DHCPACK response.
I will describe the composition of the DHCP message:
op (type of message, for example DHCPDISCOVER, size 1 byte)
htype (type of hardware address, size 1 byte)
hlen (length of hardware address, for example 6 for MAC address, size 1 byte)
hops (the number of relay agents between the server and the client, the clients set the value to 0, the size of 1 byte)
xid (Transaction ID, generated by the client at the beginning, size 4 bytes)
secs (the elapsed time in seconds from the time of requesting the receipt of the address can be 0, the size of 2 bytes)
flags (field for flags, size 2 bytes)
ciaddr (The IP address of the client, for example, if it requests a lease extension, the size is 4 bytes)
yiaddr (IP address offered by the server to the client, size 4 bytes)
siaddr (Server IP address, size 4 bytes)
giaddr (IP address of the relay agent, size 4 bytes)
chaddr (hardware client address (MAC), size 16 bytes)
sname (server name, 64 bytes)
file (the name of the boot file, can be used to boot the operating system over the network, 128 bytes)
options (additional options)