TTL - what is it?

TTL - what is it? TTL stands for Time to Live. That is, the lifetime of the package allocated to it at the time of transition from the initial node to the final one. In IPv4, an eight-bit header field is allocated to reflect TTL. Passing through numerous nodes to the destination, the value of the packet each time decreases by 1 unit. This is done in order to limit the time of its presence in the nodes to a specific number. And this, in turn, avoids network congestion.

As conceived by the authors of the technology, the lifetime of a package loses 1 unit every second. But due to the high connection speeds and the number of routers and nodes, the reduction is much faster.

ttl is that

What happens if the TTL value reaches zero? The packet will disappear, and the sender will receive a message stating that its life has expired, which means you need to try again. The maximum value that an eight-bit field can reflect is 255. For operating systems, there are default values. For example, TTL on Windows is 128, and on Linux and its derivatives Mac, Android 64.

The DNS environment has its own TTL, and it reflects the relevance of cached data. But the article will not be about him.

What is TTL used for and in which areas

The lifetime of the package is actively used by various Internet providers, for example Yota. Thus, they are trying to limit access to the consumption of excessive traffic when distributing Wi-Fi. This is due to the fact that the packet, passing from the device receiving traffic to the distributor, reduces the TTL, as a result, the provider receives a value less or, in the case of Windows, more than expected.

For example, you can describe the process of working a smartphone based on the "Android". The device sends a request to receive data from a specific site. Together with it, a TTL is sent, the value of which is 64. The provider knows that this is the standard packet lifetime figure for this device, so it freely allows it to access the network.

ttl windows

Now the device starts distributing Wi-Fi and becomes a kind of router. The connected smartphone runs on the Windows platform, and its TTL, having passed through the distribution device, will be 127. The provider will meet this package and understand that its Internet is being distributed. Therefore, it will block the joint.

TTL change options on various devices

Changing the value of the packet lifetime may be useful to bypass the blocking of traffic by the provider. For example, if you disconnected the cable connection, and the user urgently needs to access the Internet from a computer. Then the smartphone becomes an access point and brings the PC to the network.

change ttl

It is worth noting that some providers block access not only by TTL, but also track website visits. And if the resource is in no way connected with the smartphone, that is, it does not need it, the connection is disconnected.

There are several ways to change TTL, which will be described later.

Change TTL on Android devices

The easiest way to change the lifetime of a package on Android devices is to use specialized software. For example, a very effective product is TTL Master. It can change the lifetime of the package of the distributor to that resulting from the passage of data. For example, when distributing Wi-Fi to a device with Windows, you need to set the value to 127, and on Android or Linux - 63.

ttl modem

The program is free and can be easily found in the official Google Play store. However, for its operation, root privileges on the device are required.

The program interface is simple - the current value of the parameter is displayed in the upper part. Below are blanks for Windows and the rest. You can also set the desired value manually. A little lower is a button with the ability to switch from the application immediately to the modem settings. In some versions, a solution is available through iptables, for which there is a certain item.

In the settings, it is possible to set the start and change of the lifetime automatically when the device boots. Some versions of Android allow you to launch an access point immediately after changing the value. There is support for the Russian language.

ttl value

The application is constantly developing and improving. There is a profile on github in which everyone can branch out and add their capabilities to the project. If they are accepted by the developers, they will be included in a subsequent release.

You can also try the method of changing system files manually to change the value of the package lifetime. This will require root privileges. First you need to switch to flight mode, that is, make sure that the phone loses the Network.

Then use any explorer that is able to edit files. In it, you need to go along the path proc / sys / net / ipv4. In this directory, a file named ip_default_ttl is of interest. It contains the value 64, which needs to be changed to 63.

Next, you need to bring the phone out of flight mode so that it registers on the Web again. Now you can distribute wireless Internet and try to connect a device based on iOS or Android, that is, with TTL 64.

ttl change

If you want to use Windows PCs as one of the clients, you will need to set a constant value for the package lifetime in the manner described below.

Change TTL on a computer with Windows operating systems

If you need to distribute the Internet from your Android smartphone to a computer running Windows, you will have to slightly adjust the registry values. This method will be relevant when the phone does not have a root and it is not possible to bypass the lock on it.

The registry can be launched in the operating system line through the "Start" menu item "Run". In it you need to enter Regedit and click OK. Two areas appear in the window that opens. The tree structure is on the left, and the values ​​are on the right. Find the branch HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Tcpip \ Parameters. For Windows 8, Tcpip can be replaced with Tcpip6.

usb ttl converter

In the window with the values ​​you need to create a new one. This is done by right-clicking. In the context menu, select "Create", then a new DWORD parameter, and the name Default TTL is assigned. What is it? This will be a static parameter for a constant value of the lifetime. Then right-click again, and select "Modify." The number type must be decimal, and the value must be 65. Thus, the system will transfer the lifetime of the package to 65, that is, one more than that of Android. That is, passing through a smartphone, it will lose one unit, and the provider will not notice the catch. After the changes you need to restart the computer.

Now you can distribute the Internet to Android without using any special software or devices.

Linux change

How is the TTL change performed on a computer with Linux operating systems? For Linux, changing the lifetime of a package changes with one line in the terminal: sudo iptables -t mangle -A POSTROUTING -j TTL --ttl-set 65

Changing the lifetime of a packet on modems

You can change the TTL of the modem by changing the IMEI. This is an identification code unique to each device with access to cellular networks. The whole problem is that there is no universal way. This is due to the fact that for each individual modem there must be its own firmware, which will replace IMEI.

On w3bsit3-dns.com there is a selection of solutions for changing the life time on modems from different manufacturers and models. You can also find detailed implementations of this task there.

Change package lifetime on iOS

Using the tweeter, TetherMe can be changed to iOS TTL. What it is? This is a deb application that unlocks modem mode on iOS devices on board. The fact is that Apple allows some network operators to block the "Modem Mode" function at the SIM card level. This application makes it possible to activate it and use the phone as a modem.

Change TTL on MacOS

MacOS by default has a lifetime of 64. If you want to change it, you need to enter the command in the terminal: sudo sysctl -w net.inet.ip.ttl = 65.

However, with this approach, the value after rebooting will again change to 64. Therefore, a number of manipulations are necessary. There is a directory at the root of the disk It is hidden, but you need to get into it. The sysctl.conf file is created there. In it, you need to register only one line - net.inet.ip.ttl = 65. Well, of course, save.

To display this hidden folder in Findere, go to the main disk and press the key combination cmd + shift + G. In the window that appears, enter the name of the desired folder, after which it will be found.

conclusions

There is such a thing as a USB TTL converter. However, it has nothing to do with the context of the article, and do not confuse it with the lifetime of the package. USB TTL Converter is a kind of adapter for creating connections between USB devices and TTL logic.

The article explained in detail about TTL - what it is and what it is for. Several ways to change it will circumvent the restriction on blocking traffic on some providers. This makes it possible to use the Internet everywhere.

The implementation on different devices is different, you can do this either using software tools or manually changing system files. Some modems will have to be flashed, and for each version of your software.

With these instructions, you can bypass the blocking of many providers that provide Internet access through a cellular network.

Source: https://habr.com/ru/post/K7501/


All Articles