<commit_before># Network Binding

This binding allows checking whether a device is currently available on the network.
This is either done using [ping](https://en.wikipedia.org/wiki/Ping_%28networking_utility%29) or by a successful TCP connection on a specified port.

It is also capable to perform bandwidth speed tests.

## Binding configuration

The binding has the following configuration options:

-   **allowSystemPings:** Use the external ICMP ping program of the operating system instead of the Java ping. Useful if the devices cannot be reached by Java ping. Default is true.
-   **allowDHCPlisten:**  If devices leave and reenter a network, they usually request their last IPv4 address by using DHCP requests. By listening for those messages, the status update can be more "real-time" without having to wait for the next refresh cycle. Default is true.
-   **arpPingToolPath:** If the arp ping tool is not called `arping` and cannot be found in the PATH environment variable, the absolute path can be configured here. Default is `arping`.
-   **cacheDeviceStateTimeInMS:** The result of a device presence detection is cached for a small amount of time. Set this time here in milliseconds. Be aware that no new pings will be issued within this time frame, even if explicitly requested. Default is 2000.

Create a `<openHAB-conf>/services/network.cfg` file and use the above options like this:

```
binding.network:allowSystemPings=true
binding.network:allowDHCPlisten=false
binding.network:arpPingToolPath=arping
binding.network:cacheDeviceStateTimeInMS=2000
```

## Supported Things

-   **pingdevice:** Detects device presence by using ICMP pings, arp pings and dhcp packet sniffing.
-   **servicedevice:** Detects device presence by scanning for a specific open tcp port.
-   **speedtest:** Monitors available bandwidth for upload and download.

## Discovery

Auto discovery can be used to scan the local network for **pingdevice** things by sending a ping to every IP on the network.
Some network tools will identify this as a network intruder alarm, therefore automatic background discovery is disabled and a manual scan needs to be issued.

Please note: things discovered by the network binding will be provided with a time to live (TTL) and will automatically disappear from the Inbox after 10 minutes.

## Thing Configuration

```
network:pingdevice:one_device [ hostname="192.168.0.64" ]
network:pingdevice:second_device [ hostname="192.168.0.65", retry=1, timeout=5000, refreshInterval=60000 ]
network:servicedevice:important_server [ hostname="192.168.0.62", port=1234 ]
network:speedtest:local "SpeedTest 50Mo" @ "Internet" [refreshInterval=20, uploadSize=1000000, url="https://bouygues.testdebit.info/", fileName="50M.iso"]
```

Use the following options for a **network:pingdevice**:

-   **hostname:** IP address or hostname of the device
-   **retry:** After how many refresh interval cycles the device will be assumed to be offline. Default is 1.
-   **timeout:** How long the ping will wait for an answer, in milliseconds. Default: `5000` (5 seconds)
-   **refreshInterval:** How often the device will be checked, in milliseconds. Default: `60000` (one minute)

Use the following additional options for a **network:servicedevice**:

-   **port:** Must not be 0. The destination port needs to be a TCP service.

Use the following options for a **network:speedtest**:

-   **refreshInterval:** How often the test will be operated, in minutes. Default: `60000` (one minute)
-   **uploadSize:** Size of the file to be uploaded in bytes. Default is 1000000.
-   **url:** Url of the speed test server.
-   **fileName:** Name of the file to download from test server
-   **initialDelay:** Delay (in minutes) before starting the first speed test (can help avoid flooding your server at startup). Default : 5.

## Presence detection - Configure target device

Devices may need to be configured to be reachable, as a device may not answer ping requests by default.
This is the case with Windows 10 equipped systems or Android and iOS devices in deep sleep mode.

### Respond to pings on Windows 10+

Pings on Windows 10 are usually blocked by the internal firewall.
Windows 10 must be configured to allow "Echo Request for ICMPv4" so that it can respond to pings.

### Android and iOS devices

Because mobile devices put themselves in a deep sleep mode after some inactivity, they do not react to normal ICMP pings.
Configure ARP ping to realize presence detection for those devices.
This only works if the devices have WIFI enabled, have been configured to use the WIFI network, and have the option "Disable wifi in standby" disabled (default).
Use DHCP listen for an almost immediate presence detection for phones and tablets when they (re)join the home Wifi network.
<commit_msg>Documentation corrections (#5960)<commit_after># Network Binding

This binding allows checking whether a device is currently available on the network.
This is either done using [ping](https://en.wikipedia.org/wiki/Ping_%28networking_utility%29) or by a successful TCP connection on a specified port.

It is also capable to perform bandwidth speed tests.

## Binding configuration

The binding has the following configuration options:

-   **allowSystemPings:** Use the external ICMP ping program of the operating system instead of the Java ping. Useful if the devices cannot be reached by Java ping. Default is true.
-   **allowDHCPlisten:**  If devices leave and reenter a network, they usually request their last IPv4 address by using DHCP requests. By listening for those messages, the status update can be more "real-time" without having to wait for the next refresh cycle. Default is true.
-   **arpPingToolPath:** If the arp ping tool is not called `arping` and cannot be found in the PATH environment variable, the absolute path can be configured here. Default is `arping`.
-   **cacheDeviceStateTimeInMS:** The result of a device presence detection is cached for a small amount of time. Set this time here in milliseconds. Be aware that no new pings will be issued within this time frame, even if explicitly requested. Default is 2000.

Create a `<openHAB-conf>/services/network.cfg` file and use the above options like this:

```
binding.network:allowSystemPings=true
binding.network:allowDHCPlisten=false
binding.network:arpPingToolPath=arping
binding.network:cacheDeviceStateTimeInMS=2000
```

## Supported Things

-   **pingdevice:** Detects device presence by using ICMP pings, arp pings and dhcp packet sniffing.
-   **servicedevice:** Detects device presence by scanning for a specific open tcp port.
-   **speedtest:** Monitors available bandwidth for upload and download.

## Discovery

Auto discovery can be used to scan the local network for **pingdevice** things by sending a ping to every IP on the network.
Some network tools will identify this as a network intruder alarm, therefore automatic background discovery is disabled and a manual scan needs to be issued.

Please note: things discovered by the network binding will be provided with a time to live (TTL) and will automatically disappear from the Inbox after 10 minutes.

## Thing Configuration

```
network:pingdevice:one_device [ hostname="192.168.0.64" ]
network:pingdevice:second_device [ hostname="192.168.0.65", retry=1, timeout=5000, refreshInterval=60000 ]
network:servicedevice:important_server [ hostname="192.168.0.62", port=1234 ]
network:speedtest:local "SpeedTest 50Mo" @ "Internet" [refreshInterval=20, uploadSize=1000000, url="https://bouygues.testdebit.info/", fileName="50M.iso"]
```

Use the following options for a **network:pingdevice**:

-   **hostname:** IP address or hostname of the device
-   **retry:** After how many refresh interval cycles the device will be assumed to be offline. Default: `1`.
-   **timeout:** How long the ping will wait for an answer, in milliseconds. Default: `5000` (5 seconds).
-   **refreshInterval:** How often the device will be checked, in milliseconds. Default: `60000` (one minute).

Use the following additional options for a **network:servicedevice**:

-   **port:** Must not be 0. The destination port needs to be a TCP service.

Use the following options for a **network:speedtest**:

-   **refreshInterval:** Interval between each test execution, in minutes. Default: `20`.
-   **uploadSize:** Size of the file to be uploaded in bytes. Default: `1000000`.
-   **url:** Url of the speed test server.
-   **fileName:** Name of the file to download from test server.
-   **initialDelay:** Delay (in minutes) before starting the first speed test (can help avoid flooding your server at startup). Default: `5`.

## Presence detection - Configure target device

Devices may need to be configured to be reachable, as a device may not answer ping requests by default.
This is the case with Windows 10 equipped systems or Android and iOS devices in deep sleep mode.

### Respond to pings on Windows 10+

Pings on Windows 10 are usually blocked by the internal firewall.
Windows 10 must be configured to allow "Echo Request for ICMPv4" so that it can respond to pings.

### Android and iOS devices

Because mobile devices put themselves in a deep sleep mode after some inactivity, they do not react to normal ICMP pings.
Configure ARP ping to realize presence detection for those devices.
This only works if the devices have WIFI enabled, have been configured to use the WIFI network, and have the option "Disable wifi in standby" disabled (default).
Use DHCP listen for an almost immediate presence detection for phones and tablets when they (re)join the home Wifi network.

{'fraction_non_alphanumeric': 0.0742089925062448, 'fraction_numerical': 0.021544546211490424, 'mean_word_length': 4.7060570071258905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6192777', 'n_tokens_mistral': 2629, 'n_tokens_neox': 2428, 'n_words': 1310}