SlideShare a Scribd company logo
國稅局,我也好想用電腦報稅
潘建宏 Jian-Hong Pan (StarNight)
@ HITCON 2023 Lightning
每年要盡國民義務報所得稅時
我的電腦
& browser
財政部國稅局
Server
Arch Linux + Chromium / Firefox
Windows + Edge / IE
圖形驗證沒圖片
圖形驗證沒圖片
網頁版所得稅報稅系統的防無人在位的機制好爛阿!
我一直被莫名其妙一分多鐘就被登出,說好的十分鐘呢?
重新登入後,又說我重複登入,上次未正常登出!???
一進系統,就把使用者登出,是讓不讓人報稅啊?
某個星期一的晚上,報了這個 bug 到國稅
局的局長信箱。
星期三下午,接到國稅局人員來電,他表示從我提供的敘述來看
像是路由出了問題。詢問我是用哪家網路服務提供商,我回答
「北都」。
他說,過去他們有發現「第四臺」網路的使用者,有和我一樣一直
直接被報稅系統登出的問題。因為報稅網站有兩個 sites (異地)
,如果連續兩個 request 是各自被導到不同的 site 會判斷成重
複登入系統或是登入資訊錯誤。請我試試,用手機的電信網路,
看還會不會有一樣的問題。當晚我使用手機的網路,連進報稅系
統,的確就不會被錯誤的登出。
隔天國稅局人員再次來電,詢問測試結果。
我回覆,的確使用手機電信網路可以正常報稅。
他表示,那他們會再去函北都,請協助路由相關導引。
接著我詢問,這是因為國稅局報稅系統是有做 load balance
嗎?
他回覆,這的確是與 load balance 有關,使用者的 requset 被
導錯到兩個 load balance 的 sites。
嗯 ... Hmm ... 好吧! 嗯 … ???
OS:聞起來像是 GSLB ...
Load Balancing
Client #N
Client #1
.
.
.
Server #1
Server #2
.
.
.
Server #M
Load Balancer
Random
Round Robin
Least Connections
…
Not Persistence & Servers Store Sessions Locally
Client
Server #1
Server #2
.
.
.
Server #M
Load Balancer
Login
Process
Persistence by Session
Client
Server #1
Server #2
.
.
.
Server #M
Load Balancer
Login
Process
by Session
Persistence with Session Server
Client
Server #1
Session
Server
Server #M
Load Balancer
Login
Process
Session
Session
Random
Round Robin
…
Global Server Load Balance (GSLB)
Client
Server #1
Server #2
10.0.1.1
10.0.2.1
192.168.3.5
DNS Server
00xx.d-t.com A 10.0.1.1 30
00xx.d-t.com A 10.0.1.2 30
DNS
Acess
Short TTL
Random
Round Robin
Geoloaction
…
GSLB Not Persistence & Store Sessions Locally
Client
Server #1
Server #2
10.0.1.1
10.0.2.1
192.168.3.5
DNS Server
00xx.d-t.com A 10.0.1.1 30
00xx.d-t.com A 10.0.1.2 30
DNS
Login
Process
Short TTL
sh-5.1$ ping tw.yahoo.com -c 1
PING fp-ycpi.g03.yahoodns.net (180.222.109.252) 56(84) bytes of data.
^C
--- fp-ycpi.g03.yahoodns.net ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
sh-5.1$ ping tw.yahoo.com -c 1
PING fp-ycpi.g03.yahoodns.net (180.222.106.12) 56(84) bytes of data.
64 bytes from e2.ycpi.vip.tpb.yahoo.com (180.222.106.12): icmp_seq=1 ttl=51
time=12.2 ms
--- fp-ycpi.g03.yahoodns.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 12.197/12.197/12.197/0.000 ms
GSLB with Local DNS (LDNS) to Get Persistence
Client
Server #1
Server #2
10.0.1.1
10.0.2.1
192.168.3.5
DNS Server
d-t.com NS ldns1.d-t.com
d-t.com NS ldns2.d-t.com
ldns1.d-t.com A 10.0.1.253
ldns2.d-t.com A 10.0.2.253
00xx.d-t.com cname alias.d-t.com
LDNS#1 10.0.1.253
alias.d-t.com A 10.0.1.1 30
LDNS#2 10.0.2.253
alias.d-t.com A 10.0.2.1 30
Sync Status & Load Balance
Server #1 10.0.1.1 wins
DNS#2 gets
10.0.1.1
DNS#1 gets
alias.d-t.com
GSLB with Local DNS (LDNS) to Get Persistence
Client
Server #1
Server #2
10.0.1.1
10.0.2.1
192.168.3.5
DNS Server
d-t.com NS ldns1.d-t.com
d-t.com NS ldns2.d-t.com
ldns1.d-t.com A 10.0.1.253
ldns2.d-t.com A 10.0.2.253
00xx.d-t.com cname alias.d-t.com
LDNS#1 10.0.1.253
alias.d-t.com A 10.0.1.1 30
LDNS#2 10.0.2.253
alias.d-t.com A 10.0.2.1 30
Sync Status & Load Balance
Server #1 10.0.1.1 wins
Login
Process
https://ipinfo.io/AS131627
Reference
● 淺談 GSLB (GLOBAL SERVER LOAD-BALANCE)廣域式負載平衡
● Global Load Balancing, Caching and TTLs
● How to configure persistence in GSLB

More Related Content

More from Jian-Hong Pan

LoRaWAN class module and subsystem
LoRaWAN class module and subsystemLoRaWAN class module and subsystem
LoRaWAN class module and subsystem
Jian-Hong Pan
 
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoT
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoTLet's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoT
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoT
Jian-Hong Pan
 
The Considerations for Internet of Things @ 2017
The Considerations for Internet of Things @ 2017The Considerations for Internet of Things @ 2017
The Considerations for Internet of Things @ 2017
Jian-Hong Pan
 
Build a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded SystemBuild a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded System
Jian-Hong Pan
 
Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016
Jian-Hong Pan
 
Bind Python and C @ COSCUP 2015
Bind Python and C @ COSCUP 2015Bind Python and C @ COSCUP 2015
Bind Python and C @ COSCUP 2015
Jian-Hong Pan
 
Find the bottleneck of your system
Find the bottleneck of your systemFind the bottleneck of your system
Find the bottleneck of your system
Jian-Hong Pan
 
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevLearn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Jian-Hong Pan
 
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code Meetup
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code MeetupDebug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code Meetup
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code Meetup
Jian-Hong Pan
 
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDevMake Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
Jian-Hong Pan
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014
Jian-Hong Pan
 
Node.js 1, 2, 3
Node.js 1, 2, 3Node.js 1, 2, 3
Node.js 1, 2, 3
Jian-Hong Pan
 

More from Jian-Hong Pan (12)

LoRaWAN class module and subsystem
LoRaWAN class module and subsystemLoRaWAN class module and subsystem
LoRaWAN class module and subsystem
 
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoT
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoTLet's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoT
Let's Have an IEEE 802.15.4 over LoRa Linux Device Driver for IoT
 
The Considerations for Internet of Things @ 2017
The Considerations for Internet of Things @ 2017The Considerations for Internet of Things @ 2017
The Considerations for Internet of Things @ 2017
 
Build a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded SystemBuild a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded System
 
Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016
 
Bind Python and C @ COSCUP 2015
Bind Python and C @ COSCUP 2015Bind Python and C @ COSCUP 2015
Bind Python and C @ COSCUP 2015
 
Find the bottleneck of your system
Find the bottleneck of your systemFind the bottleneck of your system
Find the bottleneck of your system
 
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevLearn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
 
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code Meetup
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code MeetupDebug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code Meetup
Debug C/C++ Programs More Comfortably @ 2014.12.14 Trace Code Meetup
 
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDevMake Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014
 
Node.js 1, 2, 3
Node.js 1, 2, 3Node.js 1, 2, 3
Node.js 1, 2, 3
 

國稅局,我也好想用電腦報稅