2019年1月17日 星期四

C# datetime.now.tostring("yyyy/MM") 顯示為yyyy-MM的解決方法

DateTime.Now.ToString("yyyy/MM")

Output

2019-01 which is not expected, what I want is 2019/01


Use single quote to solve this problem:

DateTime.Now.ToString("yyyy'/'MM")

Output

2019/01


Yeah!!!!

2019年1月14日 星期一

Solving network problems 2

LAN connector (LAN 頭)


LAN 夾

LAN Tester

https://detail.tmall.com/item.htm?spm=a230r.1.14.13.ac6e73d8QCVwE2&id=20091962854&cm_id=140105335569ed55e27b&abbucket=19


Android network tools


https://play.google.com/store/apps/details?id=com.eakteam.networkmanager&hl=en_US



MAC Address



路由器標籤上的MAC地址(LAN/WLAN)
MAC地址英语:Media Access Control Address,直译为媒體存取控制位址,也稱為局域网地址(LAN Address),以太网地址(Ethernet Address)或物理地址(Physical Address),它是一个用來确认網路設備位置的位址。在OSI模型中,第三層網路層負責IP地址,第二層資料鏈結層則負責MAC位址。MAC地址用于在网络中唯一标示一个网卡,一台设备若有一或多个网卡,则每个网卡都需要并会有一个唯一的MAC地址。

MAC位址共48位元(6個位元組),以十六進位表示。前24位元由IEEE決定如何分配,後24位元由實際生產該網路設備的廠商自行指定。
ff:ff:ff:ff:ff:ff则作为廣播位址。
01:xx:xx:xx:xx:xx是多播地址,01:00:5e:xx:xx:xx是IPv4多播地址。

Type ipconfig /all to view MAC address

Win 10 Change MAC Address > control panel > device manager > advance > network address > default is "No value"

Same hostname > 網路上有重複的名稱

What is my ip?

https://whatismyipaddress.com/


什麼是 DNS?

https://hk.godaddy.com/help/dns-665

網域名稱系統(英文:Domain Name System,縮寫:DNS)是互联网的一项服务。它作为将域名和IP地址相互映射的一个分布式数据库,能够使人更方便地访问互联网。DNS使用TCP和UDP端口53[1]。当前,对于每一级域名长度的限制是63个字符,域名总长度则不能超过253个字符。

开始时,域名的字符仅限于ASCII字符的一个子集。2008年,ICANN通过一项决议,允许使用其它语言作为互联网顶级域名的字符。使用基于Punycode码的IDNA系统,可以将Unicode字符串映射为有效的DNS字符集。因此,诸如“XXX.香港”、“XXX.台湾”的域名可以在地址栏直接输入并访问,而不需要安装插件。但是,由于英语的广泛使用,使用其他语言字符作为域名会产生多种问题,例如难以输入,难以在国际推广等。

e.g.
https://香港大學.香港/

Refresh network status


ipconfig /renew

disable > enable network interface card

router setting page

802.11ac n/g/b


IEEE 802.11a
主條目:IEEE 802.11a
IEEE 802.11a802.11原始標準的一個修訂標準,於1999年獲得批准。802.11a標準採用了與原始標準相同的核心協定,工作頻率為5GHz,使用52個正交頻分多工副載波,最大原始資料傳輸率為54Mb/s,這達到了現實網路中等輸送量(20Mb/s)的要求。

由於2.4G頻段日益擁擠,使用5G頻段是802.11a的一個重要的改進。但是,也帶來了問題。傳輸距離上不及802.11b/g;理論上5G信號也更容易被牆阻擋吸收,所以802.11a的覆蓋不及801.11b802.11a同樣會被干擾,但由於附近干擾信號不多,所以802.11a通常輸送量比較好。

IEEE 802.11b
主條目:IEEE 802.11b
IEEE 802.11b是無線局域網的一個標準。其載波的頻率為2.4GHz,可提供125.511Mbit/s的多重傳送速度[1]。它有時也被錯誤地被標為Wi-Fi。實際上Wi-FiWi-Fi聯盟的一個商標,該商標僅保障使用該商標的商品互相之間可以合作,與標準本身實際上沒有關係。[來源請求]2.4-GHzISM頻段共有11個頻寬為22MHz的頻道可供使用,它是11個相互重疊的頻段。IEEE 802.11b的後繼標準是IEEE 802.11g

IEEE 802.11g
主條目:IEEE 802.11g
IEEE 802.11g20037月被通過。其載波的頻率為2.4GHz(跟802.11b相同),共14個頻段,原始傳送速度為54Mbit/s,淨傳送速率約為24.7Mbit/s(跟802.11a相同)。802.11g的設備向下與802.11b相容。

其後有些無線路由器廠商因應市場需要而在IEEE 802.11g的標準上另行開發新標準,並將理論傳送速率提升至108Mbit/s125Mbit/s

IEEE 802.11n
主條目:IEEE 802.11n
IEEE 802.11n,是由IEEE20041[來源請求]組成的一個新的工作組在802.11-2007的基礎上發展出來的標準,於20099月正式批准。該標準增加了對MIMO的支援,允許40MHz的無線頻寬,最大傳送速率理論值為600Mbit/s。同時,通過使用Alamouti提出的空時分組碼,該標準擴大了資料傳輸範圍。

IEEE 802.11ac
主條目:IEEE 802.11ac
IEEE 802.11ac是一個正在發展中的802.11無線計算機網路通信標準,它透過6GHz頻帶(也就是一般所說的5GHz頻帶)進行無線區域網(WLAN)通信。理論上,它能夠提供最少每秒1 Gigabit頻寬進行多站式無線區域網(WLAN)通訊,或是最少每秒500 megabits500 Mbit/s)的單一連線傳輸頻寬。


它採用並擴展了源自802.11n的空中介面(air interface)概念,包括:更寬的RF頻寬(提升至160 MHz),更多的MIMO空間串流(spatial streams,增加到8),MU-MIMO,以及高密度的解調變(modulation,最高可達到256 QAM)。它是IEEE 802.11n的繼任者。

Wireless channel


https://zh.wikipedia.org/wiki/WLAN%E4%BF%A1%E9%81%93%E5%88%97%E8%A1%A8

頻道列表[编辑]

很多国家都有法律规管这些頻道的使用,例如在一定频率范围内的最大功率电平等。网络运营商应咨询当地主管部门,因为这些规定可能会过时,世界上绝大多数国家都允许不需要申请许可证使用第1頻道到第13頻道:
頻道頻率
(MHz)
中國[6]北美地区[6]歐洲
[6][7][8]
日本[6]澳洲[9]委內瑞拉以色列台灣[10]
12412
22417
32422
42427
52432
62437
72442
82447
92452
102457
112462
122467A
132472A
142484A只能使用 802.11bB

Network adapter setting > no default gateway:


cannot connect outside network

but can ping the router

Network adapter setting > no DNS server


If we set the DNS manually, the value usually equals to the router IP because router has DNS inside.

If DNS is not set, can ping a host by ip but cannot ping by hostname

Win command nslookup


https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/nslookup-set-type

> nslookup
> set type=any
> server dns.hinet.net
> www.shichimiya.co.jp

未經授權的回答
Non-authoritative answer

http://site.whataiwant.com/?action-viewnews-itemid-128

https://blog.miniasp.com/post/2010/12/27/DNS-query-process-explained-using-nslookup.aspx



網絡設定檔 > 公用 > others cannot find / ping you
網絡設定檔 > 私人 > others can find / ping you

Desktop > Right click network icon on the bottom right corner > Network & Internet > Status > 變更連線內容 > Set 私人 / 公用

Windows XP > ICMP setting > Enable other computers ping you


網路連線 > Your connection > Properties > Advance > Settings > General > Enable firewall > Advance > Setting  > ICMP > 允許連入回應要求 ECHO

Windows 10 > Windows Defender Firewall > Advance >

Right click a folder > properties > if tab "共用" disappeared > check "服務" > check if "Server" is turned off

Cannot connect to share folder of Windows 10 from Windows XP


Solution: You need to enable SMB1 protocol in Windows 10

https://winaero.com/blog/enable-smb1-sharig-protocol-windows-10/

SMBv1 is not installed by default in Windows 10 Fall Creators Update and Windows Server, version 1709 and later versions


https://support.microsoft.com/en-nz/help/4034314/smbv1-is-not-installed-by-default-in-windows

如果您嘗試連線到只支援 SMBv1 的裝置,或者這些裝置嘗試與您連線,您可能會收到下列其中一個錯誤訊息:

2019年1月11日 星期五

[ServiceNow] Outlook Calendar Integration

Open a user record > set "Calendar Integration" = "Outlook"

Create a "Change" request > Input "Planned start date" and "Planned end date" > Save

An event invitation will be sent to Outlook, where start date and end date equal to "Planned start date" and "Planned end date"respectively.

For detail: Business rule > "change events"


2019年1月9日 星期三

Solving network problems

- Introduction

Impact if no internet?

cannot play game
cannot validate software license
no social network
no youtube
no google

- Problem type


- Human


cable in the wrong hole?
router turn on?

- Hardware


network cable broken?
router setting?
firewall?
is network adapter working? driver installed? ip assigned?
isp problem?

how to setup a lan connector? Just refer the color of the old connector

- Broadband ISP hotline


- what checking is usually asked by the support?
ipconfig? cable? reboot router? reboot modem?


- Light of network card


The status LED's (right side facing) can show the following:
Off - The card is not receiving power or is in a boot up state
Solid Green - The card has valid IP settings
Solid Orange - The card has a fault
Flashing Green - The card does not have valid IP settings
Flashing Orange - The card is making BootP requests
Alternating Green/Orange
Rapidly - The card is booting up
Slowly - The card is making a DHCP request

The Link LED's (left side facing) can show the following
Off - The card is not receiving power, does not have a connected network cable or the device (switch/hub) connected to the card is not active
Solid Green - The card is on a network that communicates at 10mbps
Solid Orange - The card is on a network that communicates at 100mbps
Flashing Green - The card is receiving data packets at 10mbps
Flashing Orange - The card is receiving data packets at 100mbps




Category 5e


Though Cat5 and Cat5e cables are physically similar, Category 5e Ethernet adheres to more stringent IEEE standards.

“E” is for enhanced, meaning a lower-noise version where the potential for crosstalk is reduced. Crosstalk is interference that transfers from adjacent wires.

Cat5e is the most common type of cabling used for deployments due to its ability to support Gigabit speeds at a cost-effective price.

Even though both Cat5 and Cat5e support a maximum frequency of up to 100MHz, Cat5e has completely replaced its predecessor. Gigabit Ethernet utilizes 4 data pairs in comparison to Fast Ethernet which utilizes 2 data pairs.

Further, Cat 5e supports speeds of up to 1000 Mbps. It’s flexible enough for small space installations like residences, though it is still used in commercial spaces. Of all the current cabling options, Cat5e is your least expensive option.

NOTE: 100-250Mhz/1 Gbps/100m


http://www.cables-solutions.com/wp-content/uploads/2016/10/Cat-5e.jpg


- Category 6


Cat6 wiring can support up to 10 Gbps and frequencies of up to 250 MHz.

While Cat5e cable features 1.5-2 twists per cm, Cat6 cables are more tightly wound and feature 2 or more twists per cm. (The amount of twists per cm varies upon each cable manufacturer).

Cat6 cables also sport thicker sheaths in comparison to Cat5e.

Though standard Ethernet supports distances of up to 100 meters, CAT6 cable only supports 37-55 meters (depending on crosstalk) when transmitting 10 Gbps speeds.

Its thicker sheath protects against Near End Crosstalk (NEXT) and Alien Crosstalk (AXT).

Even though Cat6 and Cat6a cabling offer higher performance rates, many LANs still opt for CAT5e due to its cost-effectiveness and ability to support Gigabit speeds.

NOTE: 250-500Mhz/10 Gbps /100m.
https://cdn.gescan.com/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/c/a/cab24-4ps6ft4blu-1.jpg

- Category 7


Cat7 can also support 10 Gbps

Laboratory testing has successfully shown its ability to transmit up to 40 Gb at 50 meters and even 100 Gb at 15 meters.

The newer “Class F” cabling can support frequencies of up to 600 Mhz. That said, Cat7 has not been approved as a cable standard for telecommunications.

Cat7 offers extensive shielding to reduce signal attenuation

Cat7 is relatively stiff in comparison to previous generations of cabling.

Both individual pairs are shielded, with an additional layer of shielding over the entire cable.

The shielding needs to be grounded and Cat7 also requires special GigaGate45 (GG45) connectors to take full advantage of higher performance features.

Cat6a can perform just about the same as Cat7 but at a lower price point.

Most of our AV and IP surveillance customers opt for Cat6a STP or Cat6a FTP. Both offer shielding from alien crosstalk and interference around high voltage lines.

Cat7 is suited for use in datacenters and large enterprise networks.

Note: 600Mhz/10Gbps/100m (40Gbps at 50m/100Gbps at 15m).

https://cdn-images-1.medium.com/max/1600/0*f5mYKuaq2bf129Sb.jpg



- Windows command


ipconfig/renew

ping google.com -t

tracert google.com

what is default gateway?

what is ip 169.254.x.x?

DHCP - Dynamic Host Configuration Protocol 動態主機設定通訊協定


動態主機設定協定(DHCP)是一種使網路系統管理員能夠集中管理和自動分配IP網路位址的通信協議。在IP網路中,每個連接Internet的設備都需要分配唯一的IP位址。DHCP使網路系統管理員能從中心結點監控和分配IP地址。當某台電腦移到網路中的其它位置時,能自動收到新的IP位址。
DHCP使用了租約的概念,或稱為電腦IP位址的有效期。租用時間是不定的,主要取決於用戶在某地連接Internet需要多久,這對於教育行業和其它用戶頻繁改變的環境是很實用的。通過較短的租期,DHCP能夠在一個電腦比可用IP位址多的環境中動態地重新配置網路。DHCP支援為電腦分配靜態位址,如需要永久性IP位址的Web伺服器。


BOOTP是一種網路協定,讓電腦或其他周邊儀器可以從伺服器下載啟動程式。
BOOTP(Bootstrap Protocol)是DHCP的前身,本來是設計用來給無磁碟主機透過網路開機用的協定,它與DHCP最大的不同有:
  1. 會要求一個boot file,用來開機。
  2. 不支援動態 IP 分配,也因此BOOTP 客戶端不知道有關DHCP中租約時間的部份。
由於BOOTP與DHCP的封包格式極為相似,因此有的DHCP 伺服器也支援BOOTP協定, 也能夠回應BOOTP客戶端的請求,但是由於BOOTP不支援DHCP的租約時間選項, 因此DHCP伺服器在發放IP給BOOTP客戶端時,基本上是假設租約時間無上限,也就是不回收發給 BOOTP 客户端的IP地址。 

APIPA - Automatic Private IP Addressing 自動私人 IP 位址


APIPA是一個DHCP容錯移轉機制。當DHCP伺服器出故障時, APIPA169.254.0.1 169.254.255.254的私有空間內分配位址,所有設備使用預設的網路遮罩255.255.0.0。客戶機調整它們的位址使用它們在使用ARP的局域網中是唯一的。APIPA可以為沒有DHCP伺服器的單網段網路提供自動配置TCP/IP協定的功能

Examples of Where APIPA May Be Useful

Example 1: No Previous IP Address and no DHCP Server

When your Windows-based computer (configured for DHCP) is initializing, it broadcasts three or more "discover" messages. If a DHCP server does not respond after several discover messages are broadcast, the Windows computer assigns itself a Class B (APIPA) address. Then the Windows computer will display an error message to the user of the computer (providing it has never been assigned an IP address from a DHCP server in the past). The Windows computer will then send out a Discover message every three minutes in an attempt to establish communications with a DHCP server.

Example 2: Previous IP Address and no DHCP Server

The computer checks for the DHCP server and if none are found, an attempt is made to contact the default gateway. If the default gateway replies, then the Windows computer retains the previously-leased IP address. However, if the computer does not receive a response from the default gateway or if none are assigned, then it uses the automatic private IP addressing feature to assign itself an IP address. An error message is presented to the user and discover messages are transmitted every 3 minutes. Once a DHCP server comes on line, a message is generated stating communications have been re-established with a DHCP Server.

Example 3: Lease Expires and no DHCP Server

The Windows-based computer tries to re-establish the lease of the IP address. If the Windows computer does not find a DCHP server, it assigns itself an IP address after generating an error message. The computer then broadcasts four discover messages, and after every 5 minutes it repeats the whole procedure until a DHCP server comes on line. A message is then generated stating that communications have been re-established with the DHCP Server.


範例 1:沒有先前的 IP 位址,也沒有 DHCP 伺服器

當您的 Windows 電腦 (已設定為適用於 DHCP) 正在初始化時,會廣播 3 項或更多的「探索」訊息。如果廣播數次探索訊息之後,DHCP 伺服器沒有回應,Windows 電腦就會自己指定「類別 B」(APIPA) 的位址。然後,Windows 電腦會向電腦的使用者顯示錯誤訊息 (如果電腦過去沒有從 DHCP 伺服器取得 IP 位址)。接著,Windows 電腦會每 3 分鐘傳送一次「探索」訊息,以試圖建立與 DHCP 伺服器的通訊。

範例 2:具有先前的 IP 位址,但沒有 DHCP 伺服器

電腦會查看 DHCP 伺服器,如果找不到 DHCP 伺服器,就會圖連接預設的閘道。如果預設閘道發出回覆,Windows 電腦就會保留先前租用的 IP 位址。然而,如果電腦沒有收到預設閘道的回應,或者沒有指定的預設閘道,就會使用自動私人 IP 位址自己指定 IP 位址。使用者會收到錯誤訊息,並且每 3 分鐘電腦就會傳送探索訊息。一旦 DHCP 伺服器連線,就會產生訊息,說明已經與 DHCP 伺服器重新建立通訊。

範例 3:租用到期且沒有 DHCP 伺服器

Windows 電腦試著重新建立 IP 位址的租用。如果 Windows 電腦沒有找到 DCHP 伺服器,就會在產生錯誤訊息之後,自己指定 IP 位址。然後電腦會廣播四個 Discover 訊息,之後每隔 5 分鐘便會重複整個程序,直到 DHCP 伺服器連線為止。接著會產生訊息,說明已經與 DHCP 伺服器重新建立通訊。