Saturday, December 18, 2021

2.5 Gbps Ethernet slowing down

 I was having issues again with the unexpected slowness of my internet access.  This time turns out due to failure in ethernet auto-negotiation.  My PC's ethernet interface is 2.5 Gbps, as well MoCA adapter that is connected to it.  It was working fine, until yesterday, where I got only 90's Mbps on SpeedTest.

There is cool PowerShell command to display the link speed: Get-NetAdapter.

We can create a DOS shell wrapper, so invoking this from a regular DOS prompt would work.

For example, I put this command in a file called "getnet.ps1".  I created another DOS script called "getnet.cmd" with the content of it just calling getps1.ps1:


In getnet.ps1:

Get-NetAdapter


In getnet.cmd:

call getnet.ps1


For example:

C:\Users\anon\bin>type getnet.cmd

call getnet.ps1


C:\Users\lshih\bin>getnet


C:\Users\lshih\bin>call getnet.ps1


Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed

----                      --------------------                    ------- ------       ----------             ---------

Bluetooth Network Conn... Bluetooth Device (Personal Area Netw...      27 Disconnected 38-FC-98-13-E9-2A         3 Mbps

2.5 GigE LAN              Realtek Gaming 2.5GbE Family Contr...#2      21 Up           04-42-1A-0C-2C-C4       2.5 Gbps

vEthernet (2.5 GigE LAN)  Hyper-V Virtual Ethernet Adapter             16 Up           00-15-5D-76-F1-69        10 Gbps

vEthernet (1 GigE LAN)    Hyper-V Virtual Ethernet Adapter #3          52 Up           00-15-5D-D2-5B-EB        10 Gbps

1 GigE LAN                Intel(R) I211 Gigabit Network Conn...#2      14 Up           04-42-1A-0C-2C-C3         1 Gbps

vEthernet (VirtualBox ... Hyper-V Virtual Ethernet Adapter #2          40 Up           00-15-5D-F1-53-24        10 Gbps

VirtualBox Host-Only N... VirtualBox Host-Only Ethernet Adapter         7 Up           0A-00-27-00-00-07         1 Gbps

vEthernet (WSL)           Hyper-V Virtual Ethernet Adapter #4          75 Up           00-15-5D-9C-4E-D0        10 Gbps


Friday, December 17, 2021

Chinese Hackers are now the top of the list

 My gateway router has a cool security feature called Intrusive Threat Prevention (ITS).  When I checked the statistics from where most of the attacks occurred to my gateway, majority the attacks come from China.




Friday, December 10, 2021

What is the maximum Transmit Power sent by 5G Iphone?

 I have been wondering so far how much power a 5G phone, like iPhone 12, can transmit to RAN (Radio Access Network), a.k.a. a base station.

According to the table in standard document ETSI TS 138 101-1, section 6.2.1 for "UE maximum output power", the maximum power for class 2 is 26 dBm (0.398 Watt) and for class 3 is 23 dBm (0.199 Watt).  Class 2 UE (User Element) only transmits at certain frequency bands only, namely n41, n77, n78, and n79, while class 3 transmits in all spectrums.


As stated, the period of measurement shall be at least one sub-frame (sfn, 1ms). 

The above maximum value is rarely reached unless the signal reception by UE or BS (Base station) is too weak.

To understand what are those NR bands, see 5G NR frequency bands - Wikipedia



Tuesday, November 30, 2021

Enabling Older Key Algorithms in SSH

Supposedly the server we want to access is at address 192.168.1.11 and it only supports older key hash algorithms.  Add those algorithms in ~/.ssh/config, such as:


 Host 192.168.1.11
        KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
        PubkeyAcceptedAlgorithms +ssh-rsa
        HostkeyAlgorithms +ssh-rsa



On another occasion, when I do that on Windows 11, I have to create a file %USERPROFILE%\.ssh\config with the content:


Host 192.168.1.11
    KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa
    MACS hmac-md5,hmac-sha1




Monday, November 29, 2021

Some tools to display EXIF data

 exifprobe

exiftags

exiftran

exiv2

fim

mediainfo (my favorite)


To install some of those, just install the following:

forensics-all

forensics-extra


Saturday, November 27, 2021

Storage Format for USB Hard Disk

 I recently bought a 5 TB USB3 hard disk to back up my data (mostly my photo and video files.  I had a data disaster recently, so I bought the EaseUS disaster backup data recovery tool, but it required a huge amount of data to restore).

Out of the box, without paying attention to the factory default format it has (extFAT), the 5 TB space has only about 0.6 TB space left.  I doubt I had that much-used data (as the source of the recovered data is from a 1 TB hard drive).  After doing some investigation (the detail is down below), I found out that the allocation unit size (AUS) of the removable hard disk is pretty big, I think it is too big to storage average files.  So I am in the process of backing up the data to my other hard drive (NTFS, 4k AUS), before I can reformat the drive to have a smaller AUS.

Meanwhile, I am not decided whether to stick with extFAT or change it to NTFS.  I don't really care about portability to other OSes, especially Apple products (sorry MacOS!), as I am pretty much a Windows (plus Linux) user.   Yes, I am all aware that so far Linux supports R/W to NTFS in userspace only (the kernel driver only supports read and some limited write access, but that requires some enabling).  But, the good news is that, according to the recent news, a company called Paragon is willing to make its full-blown proprietary NTFS driver (which fully supports NTFS features) to the Linux community.  The effort is planned to be available starting in Kernel 5.15.  This will really boost the performance and features of NTFS in Linux.[1]

To have 256K AUS seems too expensive.  According to [3] for Test 3 and 4 (Read & Write, 1 GB of data file), extFAT is slightly faster, but for smaller files (Test 1 and 2, 1 GB file size), NTFS prevails.  For duplication or deletion (Test 8 and 9), NTFS is more than 1.60 faster than FAT32 and 1.3 faster than extFAT).

Some useful information:

For  2 TB to 16 TB hard drive, 4 KB AUS is enough for an NTFS-formatted hard drive.[2]


Disk Partition Information:


C:\Windows\System32>diskpart


Microsoft DiskPart version 10.0.22000.1
Copyright (C) Microsoft Corporation.

On computer: ASUS-ROGSTRIX-X

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online         3726 GB  1024 KB   *    *
  Disk 1    Online          698 GB      0 B   *    *
  Disk 2    Online          298 GB  1024 KB   *    *
  Disk 3    Online          931 GB  3072 KB        *
  Disk 4    Online         4657 GB      0 B        *
  Disk 5    Online           14 GB      0 B

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     X   BACKUP_DISK  NTFS   Simple      3726 GB  Healthy
  Volume 1     Z   SpannedDisk  NTFS   Spanned      996 GB  Healthy
  Volume 2         System Rese  NTFS   Partition    549 MB  Healthy
  Volume 3     C                NTFS   Partition    929 GB  Healthy    Boot
  Volume 4                      NTFS   Partition    544 MB  Healthy
  Volume 5                      FAT32  Partition    299 MB  Healthy    System
  Volume 6                      NTFS   Partition    609 MB  Healthy    Hidden
  Volume 7     I   One Touch    exFAT  Partition   4657 GB  Healthy
  Volume 8         EFI          FAT32  Partition    200 MB  Healthy    Hidden
  Volume 9     E   Win10Pro     NTFS   Removable     14 GB  Healthy

DISKPART> select disk 4

Disk 4 is now the selected disk.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    System             200 MB    20 KB
  Partition 2    Primary           4657 GB   201 MB


select partition 2

Partition 2 is now the selected partition.


DISKPART> filesystems

Current File System

  Type                 : exFAT
  Allocation Unit Size : 256K
  Flags : 00000000

File Systems Supported for Formatting

  Type                 : NTFS (Default)
  Allocation Unit Sizes: 4096 (Default), 8192, 16K, 32K, 64K, 128K, 256K, 512K, 1024K, 2048K

  Type                 : exFAT
  Allocation Unit Sizes: 512K, 1024K, 2048K (Default), 4096K, 8192K, 16384K, 32768K

DISKPART>





Ref:

[1] Linux boosts Microsoft NTFS support as Linus Torvalds complains about GitHub merges | ZDNet

[2] Default cluster size for NTFS, FAT, and exFAT (microsoft.com)

[3] Flexense - Data Management Software - FAT32 vs. exFAT vs. NTFS USB3 Performance Comparison